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

ExcludeDefaultInterceptorsHandler

public class ExcludeDefaultInterceptorsHandler extends AbstractAttributeHandler
This handler is responsible for handling the javax.ejb.ExcludeDefaultInterceptors annotation.

Fields Summary
Constructors Summary
public ExcludeDefaultInterceptorsHandler()

    
Methods Summary
public java.lang.ClassgetAnnotationType()

return
the annoation type this annotation handler is handling

        return ExcludeDefaultInterceptors.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.setExcludeDefaultInterceptors(true);
            
            if(ElementType.METHOD.equals(ainfo.getElementType())) {
                Method m = (Method) ainfo.getAnnotatedElement();
                MethodDescriptor md = 
                    new MethodDescriptor(m, MethodDescriptor.EJB_BEAN);
                binding.setBusinessMethod(md);
            }

            ejbBundle.prependInterceptorBinding(binding);
        }

        return getDefaultProcessedResult();