public final Object invokeInterceptor ( Object bean , InvocationContext inv , Object [ ] interceptors ) throws Exception { // Interceptor instance is the bean instance itself if the // interceptor index is < 0. Object interceptorInstance = ( ivBeanInterceptor ) ? bean : interceptors [ ivInterceptorIndex ] ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) // d367572.7 { Tr . debug ( tc , "invoking " + this ) ; Tr . debug ( tc , "interceptor instance = " + interceptorInstance ) ; } // Does interceptor method require InvocationContext as an argument? if ( ivRequiresInvocationContext ) { try { // Yes it does, so pass it as an argument. Object [ ] args = new Object [ ] { inv } ; // d404122 return ivInterceptorMethod . invoke ( interceptorInstance , args ) ; // d404122 } catch ( IllegalArgumentException ie ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "ivInterceptorMethod: " + ivInterceptorMethod . toString ( ) + " class: " + ivInterceptorMethod . getClass ( ) + " declaring class: " + ivInterceptorMethod . getDeclaringClass ( ) ) ; Tr . debug ( tc , "interceptorInstance: " + interceptorInstance . toString ( ) + " class: " + interceptorInstance . getClass ( ) ) ; } throw ie ; } } else { // Nope, interceptor method takes no arguments. return ivInterceptorMethod . invoke ( interceptorInstance , NO_ARGS ) ; } }
Invoke the interceptor method associated with the interceptor index that was passed as the interceptorIndex parameter of the constructor method of this class .