private Object executeInterception(Method thisMethod, Object[] args, InterceptionType interceptionType) throws Throwable
{
List<InterceptionHandler> interceptionHandlers = new ArrayList<InterceptionHandler>();
for (InterceptionModel interceptionModel : interceptionModels)
{
List<?> interceptorList = interceptionModel.getInterceptors(interceptionType, thisMethod);
for (Object interceptorReference : interceptorList)
{
interceptionHandlers.add(interceptorHandlerInstances.get(interceptorReference));
}
}
if (targetClassInterceptorMetadata != null && targetClassInterceptorMetadata.getInterceptorMethods(interceptionType) != null && !targetClassInterceptorMetadata.getInterceptorMethods(interceptionType).isEmpty())
{
interceptionHandlers.add(new DirectClassInterceptionHandler<Class<?>>(getTargetInstance(), targetClassInterceptorMetadata));
}
InterceptionChain chain = new InterceptionChain(interceptionHandlers, interceptionType, getTargetInstance(), thisMethod, args);
return chain.invokeNext(new InterceptorInvocationContext(chain, getTargetInstance(), thisMethod, args));
}