*/
public static Interceptor[] createLifecycleCallbackInterceptors(Advisor advisor, List<Class<?>> lifecycleInterceptorClasses, Class<? extends Annotation> lifecycleAnnotationType, String stackName)
{
List<Interceptor> interceptors = new ArrayList<Interceptor>();
AdviceStack stack = advisor.getManager().getAdviceStack(stackName);
if(stack == null)
{
log.warn("EJBTHREE-1480: " + stackName + " has not been defined for " + toString(advisor.getManager()));
interceptors.add(new CurrentInvocationInterceptor());
Interceptor invocationContextInterceptor;
try
{
invocationContextInterceptor = PerVmAdvice.generateInterceptor(null, new InvocationContextInterceptor(), "setup");
}
catch (Exception e)
{
throw new RuntimeException("Could not generate invocation context interceptor", e);
}
interceptors.add(invocationContextInterceptor);
}
else
{
interceptors.addAll(Arrays.asList(stack.createInterceptors(advisor, null)));
}
// 12.7 footnote 57: ignore method level interceptors
// The lifecycle callbacks on the interceptors must be invoked in order
for(Class<?> interceptorClass : lifecycleInterceptorClasses)