String methodName = aroundInvoke.getMethodName();
MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(Object.class, methodName, new Class<?>[]{InvocationContext.class});
// TODO: This constructor for InterceptorMethodDescription needs a review. How does one get hold of the "declaraingClass"
// for a DD based interceptor configuration. Why not just specify the instance class and then "find" the correct method
// internally
InterceptorMethodDescription aroundInvokeMethodDescription = new InterceptorMethodDescription(interceptor.getInterceptorClass(), interceptor.getInterceptorClass(), methodIdentifier, false);
// add the around-invoke to the interceptor description
interceptorDescription.addAroundInvokeMethod(aroundInvokeMethodDescription);
}
}
// post-construct(s) of the interceptor configured (if any) in the deployment descriptor
LifecycleCallbacksMetaData postConstructs = interceptor.getPostConstructs();
if (postConstructs != null) {
for (LifecycleCallbackMetaData postConstruct : postConstructs) {
String methodName = postConstruct.getMethodName();
MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(Void.TYPE, methodName, new Class<?>[]{InvocationContext.class});
// TODO: This constructor for InterceptorMethodDescription needs a review. How does one get hold of the "declaraingClass"
// for a DD based interceptor configuration. Why not just specify the instance class and then "find" the correct method
// internally
InterceptorMethodDescription postConstructInterceptor = new InterceptorMethodDescription(interceptor.getInterceptorClass(), interceptor.getInterceptorClass(), methodIdentifier, false);
// add it to the interceptor description
interceptorDescription.addPostConstructMethod(postConstructInterceptor);
}
}
// pre-destroy(s) of the interceptor configured (if any) in the deployment descriptor
LifecycleCallbacksMetaData preDestroys = interceptor.getPreDestroys();
if (preDestroys != null) {
for (LifecycleCallbackMetaData preDestroy : preDestroys) {
String methodName = preDestroy.getMethodName();
MethodIdentifier methodIdentifier = MethodIdentifier.getIdentifier(Void.TYPE, methodName, new Class<?>[]{InvocationContext.class});
// TODO: This constructor for InterceptorMethodDescription needs a review. How does one get hold of the "declaraingClass"
// for a DD based interceptor configuration. Why not just specify the instance class and then "find" the correct method
// internally
InterceptorMethodDescription preDestroyInterceptor = new InterceptorMethodDescription(interceptor.getInterceptorClass(), interceptor.getInterceptorClass(), methodIdentifier, false);
// add it to the interceptor description
interceptorDescription.addPreDestroyMethod(preDestroyInterceptor);
}
}
}