if(interceptorList != null)
{
for (InterceptorMetadata interceptorReference : interceptorList)
{
// TODO: maybe store the interceptor instances on a different key
interceptorInvocations.add(new InterceptorInvocation(bean.getInterceptor(interceptorReference.getInterceptorClass().getJavaClass()), interceptorReference, interceptionType));
}
}
if (targetClassInterceptorMetadata != null && targetClassInterceptorMetadata.getInterceptorMethods(interceptionType) != null && !targetClassInterceptorMetadata.getInterceptorMethods(interceptionType).isEmpty())
{
interceptorInvocations.add(new InterceptorInvocation(targetInstance, targetClassInterceptorMetadata, interceptionType));
}
SimpleInterceptionChain chain = new SimpleInterceptionChain(interceptorInvocations, interceptionType, targetInstance, method);
try
{
return chain.invokeNextInterceptor(new EJBInterceptorInvocationContext(chain, contextData, targetInstance, method, args));