Search in sources :

Example 1 with TranslationResults

use of org.glassfish.ejb.deployment.util.InterceptorBindingTranslator.TranslationResults in project Payara by payara.

the class EjbDescriptor method applyInterceptors.

/**
 * Derive all interceptors that are applicable to this bean.
 * @param bindingTranslator
 */
public void applyInterceptors(InterceptorBindingTranslator bindingTranslator) {
    // Apply this ejb to the ordered set of all interceptor bindings
    // for this ejb-jar.  The results will contain all interceptor
    // information that applies to the ejb.  There is no notion of
    // default interceptors within the results.  Default interceptors
    // are used during the translation process but once we derive
    // the per-ejb interceptor information there is only a notion of
    // class-level ordering and method-level ordering.  Any applicable
    // default interceptors will have been applied to the class-level.
    TranslationResults results = bindingTranslator.apply(getName());
    allInterceptorClasses.clear();
    allInterceptorClasses.addAll(results.allInterceptorClasses);
    interceptorChain.clear();
    interceptorChain.addAll(results.classInterceptorChain);
    methodInterceptorsMap.clear();
    methodInterceptorsMap.putAll(results.methodInterceptorsMap);
    for (EjbInterceptor interceptor : allInterceptorClasses) {
        for (Object ejbRefObj : interceptor.getEjbReferenceDescriptors()) {
            addEjbReferenceDescriptor((EjbReference) ejbRefObj);
        }
        for (Object msgDestRefObj : interceptor.getMessageDestinationReferenceDescriptors()) {
            addMessageDestinationReferenceDescriptor((MessageDestinationReferenceDescriptor) msgDestRefObj);
        }
        for (Object envPropObj : interceptor.getEnvironmentProperties()) {
            addOrMergeEnvironmentProperty((EnvironmentProperty) envPropObj);
        }
        for (Object servRefObj : interceptor.getServiceReferenceDescriptors()) {
            addServiceReferenceDescriptor((ServiceReferenceDescriptor) servRefObj);
        }
        for (Object resRefObj : interceptor.getResourceReferenceDescriptors()) {
            addResourceReferenceDescriptor((ResourceReferenceDescriptor) resRefObj);
        }
        for (Object resourceEnvRefObj : interceptor.getResourceEnvReferenceDescriptors()) {
            addResourceEnvReferenceDescriptor((ResourceEnvReferenceDescriptor) resourceEnvRefObj);
        }
        for (EntityManagerFactoryReferenceDescriptor entMgrFacRef : interceptor.getEntityManagerFactoryReferenceDescriptors()) {
            addEntityManagerFactoryReferenceDescriptor(entMgrFacRef);
        }
        for (EntityManagerReferenceDescriptor entMgrRef : interceptor.getEntityManagerReferenceDescriptors()) {
            addEntityManagerReferenceDescriptor(entMgrRef);
        }
    }
}
Also used : EjbInterceptor(com.sun.enterprise.deployment.EjbInterceptor) TranslationResults(org.glassfish.ejb.deployment.util.InterceptorBindingTranslator.TranslationResults) EntityManagerFactoryReferenceDescriptor(com.sun.enterprise.deployment.EntityManagerFactoryReferenceDescriptor) EntityManagerReferenceDescriptor(com.sun.enterprise.deployment.EntityManagerReferenceDescriptor)

Aggregations

EjbInterceptor (com.sun.enterprise.deployment.EjbInterceptor)1 EntityManagerFactoryReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerFactoryReferenceDescriptor)1 EntityManagerReferenceDescriptor (com.sun.enterprise.deployment.EntityManagerReferenceDescriptor)1 TranslationResults (org.glassfish.ejb.deployment.util.InterceptorBindingTranslator.TranslationResults)1