Search in sources :

Example 21 with EjbInterceptor

use of com.sun.enterprise.deployment.EjbInterceptor in project Payara by payara.

the class InterceptorBindingNode method writeTotalOrdering.

private void writeTotalOrdering(Node parent, List<EjbInterceptor> interceptors, EjbDescriptor ejbDesc, MethodDescriptor method) {
    Node bindingNode = appendChild(parent, EjbTagNames.INTERCEPTOR_BINDING);
    appendTextChild(bindingNode, EjbTagNames.EJB_NAME, ejbDesc.getName());
    Node totalOrderingNode = appendChild(bindingNode, EjbTagNames.INTERCEPTOR_ORDER);
    for (EjbInterceptor next : interceptors) {
        appendTextChild(totalOrderingNode, EjbTagNames.INTERCEPTOR_CLASS, next.getInterceptorClassName());
    }
    if (method != null) {
        MethodNode methodNode = new MethodNode();
        // Write out method description. void methods will be written
        // out using an empty method-params element so they will not
        // be interpreted as overloaded when processed.
        methodNode.writeJavaMethodDescriptor(bindingNode, EjbTagNames.INTERCEPTOR_BUSINESS_METHOD, method, true);
    }
}
Also used : MethodNode(com.sun.enterprise.deployment.node.MethodNode) Node(org.w3c.dom.Node) MethodNode(com.sun.enterprise.deployment.node.MethodNode) DeploymentDescriptorNode(com.sun.enterprise.deployment.node.DeploymentDescriptorNode) EjbInterceptor(com.sun.enterprise.deployment.EjbInterceptor)

Example 22 with EjbInterceptor

use of com.sun.enterprise.deployment.EjbInterceptor in project Payara by payara.

the class AroundConstructHandler method processAnnotation.

protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbInterceptorContext ejbInterceptorContext) throws AnnotationProcessorException {
    EjbInterceptor ejbInterceptor = ejbInterceptorContext.getDescriptor();
    ejbInterceptor.addAroundConstructDescriptor(getAroundConstructDescriptor(ainfo));
    return getDefaultProcessedResult();
}
Also used : EjbInterceptor(com.sun.enterprise.deployment.EjbInterceptor)

Example 23 with EjbInterceptor

use of com.sun.enterprise.deployment.EjbInterceptor in project Payara by payara.

the class AroundInvokeHandler method processAnnotation.

protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbInterceptorContext ejbInterceptorContext) throws AnnotationProcessorException {
    EjbInterceptor ejbInterceptor = ejbInterceptorContext.getDescriptor();
    ejbInterceptor.addAroundInvokeDescriptor(getAroundInvocationDescriptor(ainfo));
    return getDefaultProcessedResult();
}
Also used : EjbInterceptor(com.sun.enterprise.deployment.EjbInterceptor)

Example 24 with EjbInterceptor

use of com.sun.enterprise.deployment.EjbInterceptor in project Payara by payara.

the class PostActivateHandler method processAnnotation.

protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo, EjbInterceptorContext ejbInterceptorContext) throws AnnotationProcessorException {
    EjbInterceptor ejbInterceptor = ejbInterceptorContext.getDescriptor();
    ejbInterceptor.addPostActivateDescriptor(getPostActivateDescriptor(ainfo));
    return getDefaultProcessedResult();
}
Also used : EjbInterceptor(com.sun.enterprise.deployment.EjbInterceptor)

Example 25 with EjbInterceptor

use of com.sun.enterprise.deployment.EjbInterceptor in project Payara by payara.

the class EjbDescriptor method getAroundInvokeInterceptors.

/**
 * Return the ordered list of interceptor info for AroundInvoke behavior
 * of a particular business method.  This list *does* include the info
 * on any bean class interceptor.  If present, this would always be the
 * last element in the list because of the precedence defined by the spec.
 * @param businessMethod
 * @return
 */
public List<EjbInterceptor> getAroundInvokeInterceptors(MethodDescriptor businessMethod) {
    LinkedList<EjbInterceptor> aroundInvokeInterceptors = new LinkedList<EjbInterceptor>();
    List<EjbInterceptor> classOrMethodInterceptors = getClassOrMethodInterceptors(businessMethod);
    for (EjbInterceptor next : classOrMethodInterceptors) {
        if (next.getAroundInvokeDescriptors().size() > 0) {
            aroundInvokeInterceptors.add(next);
        }
    }
    if (hasAroundInvokeMethod()) {
        EjbInterceptor interceptorInfo = new EjbInterceptor();
        interceptorInfo.setFromBeanClass(true);
        interceptorInfo.addAroundInvokeDescriptors(getAroundInvokeDescriptors());
        interceptorInfo.setInterceptorClassName(getEjbImplClassName());
        aroundInvokeInterceptors.add(interceptorInfo);
    }
    return aroundInvokeInterceptors;
}
Also used : EjbInterceptor(com.sun.enterprise.deployment.EjbInterceptor) LinkedList(java.util.LinkedList)

Aggregations

EjbInterceptor (com.sun.enterprise.deployment.EjbInterceptor)34 LifecycleCallbackDescriptor (com.sun.enterprise.deployment.LifecycleCallbackDescriptor)9 LinkedList (java.util.LinkedList)6 Method (java.lang.reflect.Method)5 HashSet (java.util.HashSet)5 EjbDescriptor (com.sun.enterprise.deployment.EjbDescriptor)3 InterceptorDescriptor (com.sun.enterprise.deployment.InterceptorDescriptor)3 MethodDescriptor (com.sun.enterprise.deployment.MethodDescriptor)3 Result (com.sun.enterprise.tools.verifier.Result)3 ComponentNameConstructor (com.sun.enterprise.tools.verifier.tests.ComponentNameConstructor)3 ArrayList (java.util.ArrayList)3 EjbSessionDescriptor (org.glassfish.ejb.deployment.descriptor.EjbSessionDescriptor)3 Descriptor (org.glassfish.deployment.common.Descriptor)2 Node (org.w3c.dom.Node)2 JCDIService (com.sun.enterprise.container.common.spi.JCDIService)1 BundleDescriptor (com.sun.enterprise.deployment.BundleDescriptor)1 EjbBundleDescriptor (com.sun.enterprise.deployment.EjbBundleDescriptor)1 EjbMessageBeanDescriptor (com.sun.enterprise.deployment.EjbMessageBeanDescriptor)1 EntityManagerFactoryReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerFactoryReferenceDescriptor)1 EntityManagerReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerReferenceDescriptor)1