public void bind( Name bindDn, byte[] credentials, List mechanisms, String saslAuthId ) throws NamingException { Entry next = getNextEntry(); Interceptor interceptor = next.configuration.getInterceptor();  try { interceptor.bind( next.nextInterceptor, bindDn, credentials, mechanisms, saslAuthId ); } catch ( NamingException ne ) { throw ne; } catch ( Throwable e ) { throwInterceptorException( interceptor, e ); } }  public void unbind( Name bindDn ) throws NamingException { Entry next = getNextEntry(); Interceptor interceptor = next.configuration.getInterceptor();  try { interceptor.unbind( next.nextInterceptor, bindDn ); } catch ( NamingException ne ) { throw ne; } catch ( Throwable e ) { throwInterceptorException( interceptor, e ); } }
        private Entry( Entry prevEntry, Entry nextEntry,                       InterceptorConfiguration configuration )        {            if( configuration == null )            {                throw new NullPointerException( "configuration" );            }            this.prevEntry = prevEntry;            this.nextEntry = nextEntry;            this.configuration = configuration;            this.nextInterceptor = new NextInterceptor()            {                private Entry getNextEntry()                {                    if ( InvocationStack.getInstance().isEmpty() )                    {                        return Entry.this.nextEntry;                    }                    Invocation invocation = InvocationStack.getInstance().peek();                    if ( ! invocation.hasBypass() )                    {                        return Entry.this.nextEntry;                    }//  I don't think we really need this since this check is performed by the chain when//  getting the interceptor head to use.////                    if ( invocation.isBypassed( DirectoryPartitionNexusProxy.BYPASS_ALL ) )//                    {//                        return tail;//                    }                    Entry next = Entry.this.nextEntry;                    while ( next != tail )                    {                        if ( invocation.isBypassed( next.configuration.getName() ) )                        {                            next = next.nextEntry;                        }                        else                        {                            return next;                        }                    }                    return next;                }                public boolean compare( Name name, String oid, Object value ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.compare( next.nextInterceptor, name, oid, value );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public Attributes getRootDSE() throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.getRootDSE( next.nextInterceptor );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public Name getMatchedName( Name dn, boolean normalized ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.getMatchedName( next.nextInterceptor, dn, normalized );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public Name getSuffix( Name dn, boolean normalized ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.getSuffix( next.nextInterceptor, dn, normalized );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public Iterator listSuffixes( boolean normalized ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.listSuffixes( next.nextInterceptor, normalized );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public void delete( Name name ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.delete( next.nextInterceptor, name );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                    }                }                public void add( String upName, Name normName, Attributes entry ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.add( next.nextInterceptor, upName, normName, entry );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                    }                }                public void modify( Name name, int modOp, Attributes mods ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.modify( next.nextInterceptor, name, modOp, mods );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                    }                }                public void modify( Name name, ModificationItem[] mods ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.modify( next.nextInterceptor, name, mods );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                    }                }                public NamingEnumeration list( Name base ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.list( next.nextInterceptor, base );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public NamingEnumeration search( Name base, Map env, ExprNode filter, SearchControls searchCtls ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.search( next.nextInterceptor, base, env, filter, searchCtls );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public Attributes lookup( Name name ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.lookup( next.nextInterceptor, name );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public Attributes lookup( Name dn, String[] attrIds ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.lookup( next.nextInterceptor, dn, attrIds );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public boolean hasEntry( Name name ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.hasEntry( next.nextInterceptor, name );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public boolean isSuffix( Name name ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        return interceptor.isSuffix( next.nextInterceptor, name );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public void modifyRn( Name name, String newRn, boolean deleteOldRn ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.modifyRn( next.nextInterceptor, name, newRn, deleteOldRn );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                    }                }                public void move( Name oriChildName, Name newParentName ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.move( next.nextInterceptor, oriChildName, newParentName );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                    }                }                public void move( Name oriChildName, Name newParentName, String newRn, boolean deleteOldRn ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.move( next.nextInterceptor, oriChildName, newParentName, newRn, deleteOldRn );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                    }                }                public void addContextPartition( DirectoryPartitionConfiguration cfg ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.addContextPartition( next.nextInterceptor, cfg );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }                public void removeContextPartition( Name suffix ) throws NamingException                {                    Entry next = getNextEntry();                    Interceptor interceptor = next.configuration.getInterceptor();                    try                    {                        interceptor.removeContextPartition( next.nextInterceptor, suffix );                    }                    catch ( NamingException ne )                    {                        throw ne;                    }                    catch ( Throwable e )                    {                        throwInterceptorException( interceptor, e );                        throw new InternalError(); // Should be unreachable                    }                }            };        }