}
protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
EjbContext[] ejbContexts) throws AnnotationProcessorException {
EjbBundleDescriptorImpl ejbBundle =
((EjbDescriptor)ejbContexts[0].getDescriptor()).
getEjbBundleDescriptor();
for(EjbContext next : ejbContexts) {
EjbDescriptor ejbDescriptor = (EjbDescriptor) next.getDescriptor();
// Create binding information.
InterceptorBindingDescriptor binding =
new InterceptorBindingDescriptor();
binding.setEjbName(ejbDescriptor.getName());
binding.setExcludeClassInterceptors(true);
// Annotation can be defined at a method level or constructor level.
MethodDescriptor md = null;
if(ElementType.METHOD.equals(ainfo.getElementType())) {
Method m = (Method) ainfo.getAnnotatedElement();
md = new MethodDescriptor(m, MethodDescriptor.EJB_BEAN);
} else if(ElementType.CONSTRUCTOR.equals(ainfo.getElementType())) {
Constructor c = (Constructor) ainfo.getAnnotatedElement();
Class cl = c.getDeclaringClass();
Class[] ctorParamTypes = c.getParameterTypes();
String[] parameterClassNames = (new MethodDescriptor()).getParameterClassNamesFor(null, ctorParamTypes);
md = new MethodDescriptor(cl.getSimpleName(), null,
parameterClassNames, MethodDescriptor.EJB_BEAN);
} // else throw Exception?
binding.setBusinessMethod(md);
ejbBundle.prependInterceptorBinding(binding);
}
return getDefaultProcessedResult();
}