public InterceptorMethodHandler(Object targetInstance,
ClassMetadata<?> targetClassMetadata,
InterceptionModel<ClassMetadata<?>, ?> interceptionModel,
InterceptorInstantiator<?,?> interceptorInstantiator,
InvocationContextFactory invocationContextFactory )
{
this.targetInstance = targetInstance;
this.invocationContextFactory = invocationContextFactory;
if (interceptionModel == null)
{
throw new IllegalArgumentException("Interception model must not be null");
}
if (interceptorInstantiator == null)
{
throw new IllegalArgumentException("Interception handler factory must not be null");
}
this.interceptionModel = interceptionModel;
for (InterceptorMetadata interceptorMetadata : this.interceptionModel.getAllInterceptors())
{
interceptorHandlerInstances.put(interceptorMetadata, interceptorInstantiator.createFor(interceptorMetadata.getInterceptorReference()));
}
targetClassInterceptorMetadata = InterceptorMetadataUtils.readMetadataForTargetClass(targetClassMetadata);
}