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

PostActivateHandler

public class PostActivateHandler extends AbstractAttributeHandler
This handler is responsible for handling javax.ejb.PostActivate

Fields Summary
Constructors Summary
public PostActivateHandler()

    
Methods Summary
public java.lang.ClassgetAnnotationType()

return
the annoation type this annotation handler is handling

        return PostActivate.class;
    
private com.sun.enterprise.deployment.LifecycleCallbackDescriptorgetPostActivateDescriptor(com.sun.enterprise.deployment.annotation.AnnotationInfo ainfo)

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