catch ( Throwable throwable )
catch ( InvocationTargetException ite )
    public Object invoke( Object proxy, Method method, Object[] args ) throws Throwable    {        // Setup the invocation and populate: remember aspect sets context stack        Invocation invocation = new Invocation();        invocation.setMethod( method );        invocation.setProxy( proxy );        invocation.setParameters( args );        // used for an optimization        BaseInterceptor.setInvocation( invocation );        try        {            before.invoke( invocation );        }        catch ( Throwable throwable )        {            /*             * On errors we need to continue into the failure handling state             * of Invocation processing and not throw anything just record it.             */            if ( invocation.getBeforeFailure() == null )            {                invocation.setBeforeFailure( throwable );            }            invocation.setState( InvocationStateEnum.FAILUREHANDLING );        }                /*         * If before pipeline succeeds invoke the target and change state to          * POSTINVOCATION on success but on failure record exception and set          * state to FAILUREHANDLING.         *          * If before pipeline failed then we invoke the after failure pipeline         * and throw the before failure exception.         */        if ( invocation.getState() == InvocationStateEnum.PREINVOCATION )        {            try            {                Object retVal = method.invoke( nexus, invocation.getParameters() );                invocation.setReturnValue( retVal );                invocation.setState( InvocationStateEnum.POSTINVOCATION );            }            catch ( Throwable throwable )            {                invocation.setThrowable( throwable );                invocation.setState( InvocationStateEnum.FAILUREHANDLING );            }            invocation.setComplete( true );        }        else if ( invocation.getState() == InvocationStateEnum.FAILUREHANDLING )        {            afterFailure.invoke( invocation );            BaseInterceptor.setInvocation( null );            throw invocation.getBeforeFailure();        }        /*         * If we have gotten this far then the before pipeline succeeded.  If          * the target invocation succeeded then we should be in the          * POSTINVOCATION state in which case we invoke the after pipeline.         *          * If the target invocation failed then we should run the after failure         * pipeline since we will be in the FAILUREHANDLINE state and after          * doing so we throw the original throwable raised by the target.         */        if ( invocation.getState() == InvocationStateEnum.POSTINVOCATION )        {            try            {                after.invoke( invocation );                BaseInterceptor.setInvocation( null );                return invocation.getReturnValue();            }            catch ( Throwable throwable )            {                invocation.setState( InvocationStateEnum.FAILUREHANDLING );                                if ( invocation.getAfterFailure() == null )                {                    invocation.setAfterFailure( throwable );                }                afterFailure.invoke( invocation );                BaseInterceptor.setInvocation( null );                throw invocation.getAfterFailure();            }        }        else if ( invocation.getState() == InvocationStateEnum.FAILUREHANDLING )        {            afterFailure.invoke( invocation );            if ( invocation.getThrowable() == null )            {                throw new LdapNamingException( "Interceptor Framework Failure: "                        + "failures on the proxied call should have a non null "                        + "throwable associated with the Invocation object.",                        ResultCodeEnum.OTHER );            }            BaseInterceptor.setInvocation( null );            throw invocation.getThrowable();        }        // used for an optimization        BaseInterceptor.setInvocation( null );        throw new LdapNamingException( "Interceptor Framework Failure: "                + "invocation handling should never have reached this line",                ResultCodeEnum.OTHER );    }