Hashtable env = new Hashtable(); env.put( Context.PROVIDER_URL, "ou=system" ); env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() ); env.putAll( new ShutdownConfiguration( replicaId ).toJndiEnvironment() ); env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" ); env.put( Context.SECURITY_CREDENTIALS, "secret" ); try { new InitialContext( env ); } catch( Exception e ) { }  try { FileUtils.deleteDirectory( workDir ); } catch( Exception e ) { e.printStackTrace(); }  workDir.getParentFile().delete();
Hashtable env = new Hashtable(); env.put( Context.PROVIDER_URL, "ou=system" ); env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class .getName() ); env.putAll( new ShutdownConfiguration( replicaId ) .toJndiEnvironment() ); env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" ); env.put( Context.SECURITY_CREDENTIALS, "secret" ); try { new InitialContext( env ); } catch( Exception e ) { }
	private void destroyAllReplicas() throws Exception	{		for( Iterator i = contexts.keySet().iterator(); i.hasNext(); )		{			String replicaId = ( String ) i.next();			File workDir = DirectoryService.getInstance( replicaId ).getConfiguration().getStartupConfiguration().getWorkingDirectory();	        Hashtable env = new Hashtable();	        env.put( Context.PROVIDER_URL, "ou=system" );	        env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() );	        env.putAll( new ShutdownConfiguration( replicaId ).toJndiEnvironment() );	        env.put( Context.SECURITY_PRINCIPAL, "uid=admin,ou=system" );	        env.put( Context.SECURITY_CREDENTIALS, "secret" );	        try	        {	            new InitialContext( env );	        }	        catch( Exception e )	        {	        }	        	        try	        {	        	FileUtils.deleteDirectory( workDir );	        }	        catch( Exception e )	        {	        	e.printStackTrace();	        }	        	        workDir.getParentFile().delete();	        i.remove();		}	}