Runtime.getRuntime().addShutdownHook( new Thread( new Runnable() { public void run() { try { RootNexus.this.close(); } catch ( NamingException e ) { e.printStackTrace();   } } }, "RootNexusShutdownHook" ) );
    public RootNexus( SystemPartition system, Attributes rootDSE )    {        if ( null != s_singleton )        {            throw new IllegalStateException();        }                s_singleton = this;        this.system = system;        // setup that root DSE        this.rootDSE = rootDSE;        Attribute attr = new LockableAttributeImpl( NAMINGCTXS_ATTR );        attr.add( "" );        rootDSE.put( attr );        attr = new LockableAttributeImpl( VENDORNAME_ATTR );        attr.add( ASF );        rootDSE.put( attr );        // register will add to the list of namingContexts as well        register( this.system );    }