FileDocCategorySizeDatePackage
ExcludeClassInterceptorsHandler.javaAPI DocGlassfish v2 API4598Fri May 04 22:31:34 BST 2007com.sun.enterprise.deployment.annotation.handlers

ExcludeClassInterceptorsHandler

public class ExcludeClassInterceptorsHandler extends AbstractAttributeHandler
This handler is responsible for handling the javax.ejb.ExcludeClassInterceptors annotation.

Fields Summary
Constructors Summary
public ExcludeClassInterceptorsHandler()

    
Methods Summary
public java.lang.ClassgetAnnotationType()

return
the annoation type this annotation handler is handling

        return ExcludeClassInterceptors.class;
    
public java.lang.Class[]getTypeDependencies()

return
an array of annotation types this annotation handler would require to be processed (if present) before it processes it's own annotation type.

        return getEjbAnnotationTypes();
    
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResultprocessAnnotation(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo, com.sun.enterprise.deployment.annotation.context.EjbContext[] ejbContexts)


         EjbBundleDescriptor 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 only be defined at the method level.
            Method m = (Method) ainfo.getAnnotatedElement();
            MethodDescriptor md = 
                new MethodDescriptor(m, MethodDescriptor.EJB_BEAN);
            binding.setBusinessMethod(md);

            ejbBundle.prependInterceptorBinding(binding);
        }

        return getDefaultProcessedResult();