sessions.setMinaRegistry( minaRegistry ); sessions.setLdapService( ldapService );
    public void handleExtendedOperation( IoSession requestor, SessionRegistry registry, ExtendedRequest req )        throws NamingException    {        LdapContext ctx = registry.getLdapContext( requestor, null, false );        ctx = ( LdapContext ) ctx.lookup( "" );        if ( ctx instanceof ServerLdapContext )        {            ServerLdapContext slc = ( ServerLdapContext ) ctx;            DirectoryService service = slc.getService();            if ( !slc.getPrincipal().getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) )            {                requestor.write( new LaunchDiagnosticUiResponse( req.getMessageId(),                    ResultCodeEnum.INSUFFICIENTACCESSRIGHTS ) );                return;            }            requestor.write( new LaunchDiagnosticUiResponse( req.getMessageId() ) );            DirectoryPartitionNexus nexus = service.getConfiguration().getPartitionNexus();            Iterator list = nexus.listSuffixes( true );            int launchedWindowCount = 0;            while ( list.hasNext() )            {                LdapName dn = new LdapName( ( String ) list.next() );                DirectoryPartition partition = nexus.getPartition( dn );                if ( partition instanceof BTreeDirectoryPartition )                {                    BTreeDirectoryPartition btPartition = ( BTreeDirectoryPartition ) partition;                    PartitionFrame frame = new PartitionFrame( btPartition, btPartition.getSearchEngine() );                    Point pos = getCenteredPosition( frame );                    pos.y = launchedWindowCount * 20 + pos.y;                    double multiplier = getAspectRatio() * 20.0;                    pos.x = ( int ) ( launchedWindowCount * multiplier ) + pos.x;                    frame.setLocation( pos );                    frame.setVisible( true );                    launchedWindowCount++;                }            }            SessionsFrame sessions = new SessionsFrame();            sessions.setMinaRegistry( minaRegistry );            sessions.setLdapService( ldapService );            sessions.setRequestor( requestor );            sessions.setLdapProvider( ldapProvider.getHandler() );            Point pos = getCenteredPosition( sessions );            pos.y = launchedWindowCount * 20 + pos.y;            double multiplier = getAspectRatio() * 20.0;            pos.x = ( int ) ( launchedWindowCount * multiplier ) + pos.x;            sessions.setLocation( pos );            sessions.setVisible( true );            return;        }        requestor.write( new LaunchDiagnosticUiResponse( req.getMessageId(), ResultCodeEnum.OPERATIONSERROR ) );    }