boolean definedInMethod,
List<InterceptorData> stack,
Method annotatedInterceptorClassMethod,
boolean defineWithInterceptorBinding)
{
InterceptorData intData = null;
Method method = null;
OpenWebBeansEjbLCAPlugin ejbPlugin = null;
Class<? extends Annotation> prePassivateClass = null;
Class<? extends Annotation> postActivateClass = null;
ejbPlugin = webBeansContext.getPluginLoader().getEjbLCAPlugin();
if(ejbPlugin != null)
{
prePassivateClass = ejbPlugin.getPrePassivateClass();
postActivateClass = ejbPlugin.getPostActivateClass();
}
//Check for default constructor of EJB based interceptor
if(webBeansInterceptor == null)
{
if(definedInInterceptorClass)
{
Constructor<?> ct = getNoArgConstructor(interceptorClass);
if (ct == null)
{
throw new WebBeansConfigurationException("class : " + interceptorClass.getName()
+ " must have no-arg constructor");
}
}
}
if (interceptionType.equals(AroundInvoke.class) || interceptionType.equals(AroundTimeout.class))
{
method = WebBeansUtil.checkAroundInvokeAnnotationCriterias(interceptorClass, interceptionType);
}
else if (interceptionType.equals(PostConstruct.class) || ((postActivateClass != null) && (interceptionType.equals(postActivateClass)))
|| interceptionType.equals(PreDestroy.class) || ((prePassivateClass != null) && (interceptionType.equals(prePassivateClass))))
{
method = checkCommonAnnotationCriterias(interceptorClass, interceptionType, definedInInterceptorClass);
}
if (method != null)
{
intData = new InterceptorDataImpl(defineWithInterceptorBinding, webBeansContext);
intData.setDefinedInInterceptorClass(definedInInterceptorClass);
intData.setDefinedInMethod(definedInMethod);
intData.setInterceptorBindingMethod(annotatedInterceptorClassMethod);
intData.setWebBeansInterceptor(webBeansInterceptor);
if (definedInInterceptorClass)
{
intData.setInterceptorClass(interceptorClass);
}
intData.setInterceptorMethod(method, interceptionType);
stack.add(intData);
}
}