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

PrePassivateHandler

public class PrePassivateHandler extends AbstractAttributeHandler
This handler is responsible for handling javax.ejb.PrePassivate

Fields Summary
Constructors Summary
public PrePassivateHandler()

    
Methods Summary
public java.lang.ClassgetAnnotationType()

return
the annoation type this annotation handler is handling

        return PrePassivate.class;
    
private com.sun.enterprise.deployment.LifecycleCallbackDescriptorgetPrePassivateDescriptor(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo)

        Method annotatedMethod = (Method) ainfo.getAnnotatedElement();
        LifecycleCallbackDescriptor prePassivate = 
                new LifecycleCallbackDescriptor();
        prePassivate.setLifecycleCallbackClass(annotatedMethod.getDeclaringClass().getName());
        prePassivate.setLifecycleCallbackMethod(annotatedMethod.getName());
        return prePassivate;
    
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 booleanisDelegatee()

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


        for(EjbContext next : ejbContexts) {
            
            EjbSessionDescriptor ejbSessionDescriptor = 
                (EjbSessionDescriptor) next.getDescriptor();

            ejbSessionDescriptor.addPrePassivateDescriptor(
                getPrePassivateDescriptor(ainfo));
            
        }
        
        return getDefaultProcessedResult();
    
protected com.sun.enterprise.deployment.annotation.HandlerProcessingResultprocessAnnotation(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo, com.sun.enterprise.deployment.annotation.context.EjbInterceptorContext ejbInterceptorContext)

        EjbInterceptor ejbInterceptor =  ejbInterceptorContext.getDescriptor();
        ejbInterceptor.addPrePassivateDescriptor(
            getPrePassivateDescriptor(ainfo));
        return getDefaultProcessedResult();