LdapPrincipal user = ( ( ServerContext ) InvocationStack.getInstance().peek().getCaller() ).getPrincipal();
Invocation invocation = InvocationStack.getInstance().peek(); LdapPrincipal user = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
    public Attributes lookup( NextInterceptor next, Name dn, String[] attrIds ) throws NamingException    {        Attributes entry = nexus.lookup( dn );        LdapPrincipal user = ( ( ServerContext ) InvocationStack.getInstance().peek().getCaller() ).getPrincipal();        if ( user.getName().equalsIgnoreCase( DirectoryPartitionNexus.ADMIN_PRINCIPAL ) || ! enabled )        {            return next.lookup( dn, attrIds );        }        checkLookupAccess( next, user, dn, entry );        return next.lookup( dn, attrIds );    }