public static Interceptor[] createLifecycleCallbackInterceptors(Advisor advisor, List<Class<?>> lifecycleInterceptorClasses, BeanContext<?> component, Class<? extends Annotation> lifecycleAnnotationType) throws Exception
{
List<Interceptor> interceptors = new ArrayList<Interceptor>();
AdviceStack stack = advisor.getManager().getAdviceStack("LifecycleCallbackStack");
if(stack == null)
{
log.warn("EJBTHREE-1480: LifecycleCallbackStack has not been defined for " + toString(advisor.getManager()));
interceptors.add(new CurrentInvocationInterceptor());
interceptors.add(PerVmAdvice.generateInterceptor(null, new InvocationContextInterceptor(), "setup"));
}
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)