Examples of EjbInterceptor


Examples of com.sun.enterprise.deployment.EjbInterceptor

            }
        }

        if (hasAroundTimeoutMethod()) {

            EjbInterceptor interceptorInfo = new EjbInterceptor();
            interceptorInfo.setFromBeanClass(true);
            interceptorInfo.addAroundTimeoutDescriptors(getAroundTimeoutDescriptors());
            interceptorInfo.setInterceptorClassName(getEjbImplClassName());

            aroundTimeoutInterceptors.add(interceptorInfo);
        }

        return aroundTimeoutInterceptors;
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

                callbackInterceptors.add(next);
            }
        }

        if (callbackDescriptors != null && callbackDescriptors.size() > 0) {
            EjbInterceptor beanClassCallbackInfo = new EjbInterceptor();
            beanClassCallbackInfo.setFromBeanClass(true);
            beanClassCallbackInfo.addCallbackDescriptors(type, callbackDescriptors);
            beanClassCallbackInfo.setInterceptorClassName(getEjbImplClassName());
            callbackInterceptors.add(beanClassCallbackInfo);
        }

        return callbackInterceptors;
    }
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

            }
        }

        if (hasAroundInvokeMethod()) {

            EjbInterceptor interceptorInfo = new EjbInterceptor();
            interceptorInfo.setFromBeanClass(true);
            interceptorInfo.addAroundInvokeDescriptors(getAroundInvokeDescriptors());
            interceptorInfo.setInterceptorClassName(getEjbImplClassName());

            aroundInvokeInterceptors.add(interceptorInfo);
        }

        return aroundInvokeInterceptors;
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

            }
        }

        if (hasAroundTimeoutMethod()) {

            EjbInterceptor interceptorInfo = new EjbInterceptor();
            interceptorInfo.setFromBeanClass(true);
            interceptorInfo.addAroundTimeoutDescriptors(getAroundTimeoutDescriptors());
            interceptorInfo.setInterceptorClassName(getEjbImplClassName());

            aroundTimeoutInterceptors.add(interceptorInfo);
        }

        return aroundTimeoutInterceptors;
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

                callbackInterceptors.add(next);
            }
        }

        if (callbackDescriptors != null && callbackDescriptors.size() > 0) {
            EjbInterceptor beanClassCallbackInfo = new EjbInterceptor();
            beanClassCallbackInfo.setFromBeanClass(true);
            beanClassCallbackInfo.addCallbackDescriptors(type, callbackDescriptors);
            beanClassCallbackInfo.setInterceptorClassName(getEjbImplClassName());
            callbackInterceptors.add(beanClassCallbackInfo);
        }

        return callbackInterceptors;
    }
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

                if ( logger.isLoggable( Level.FINE ) ) {
                    logger.log(Level.FINE,
                               CDILoggerInfo.ADDING_INTERCEPTOR_FOR_EJB,
                               new Object [] {next.getBeanClass().getName(), glassfishEjbDesc.getEjbClassName()});
                }
                EjbInterceptor ejbInt = makeEjbInterceptor(next, glassfishEjbDesc.getEjbBundleDescriptor());
                glassfishEjbDesc.addInterceptorClass(ejbInt);
            }
        }

        // Create ordered list of EjbInterceptor for each lifecycle interception type and append to
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

            return ejbInterceptorList;
        }

        for(Interceptor<?> next : lifecycleList ) {

            EjbInterceptor ejbInt = makeEjbInterceptor(next, ejbDesc.getEjbBundleDescriptor());
            LifecycleCallbackDescriptor lifecycleDesc = new LifecycleCallbackDescriptor();

            lifecycleDesc.setLifecycleCallbackClass(next.getBeanClass().getName());
            lifecycleDesc.setLifecycleCallbackMethod(getInterceptorMethod(next.getBeanClass(),
                    getInterceptorAnnotationType(interceptionType)));

            switch(interceptionType) {
                case POST_CONSTRUCT :
                    ejbInt.addPostConstructDescriptor(lifecycleDesc);
                    break;
                case PRE_DESTROY :
                    ejbInt.addPreDestroyDescriptor(lifecycleDesc);
                    break;
                case PRE_PASSIVATE :
                    ejbInt.addPrePassivateDescriptor(lifecycleDesc);
                    break;
                case POST_ACTIVATE :
                    ejbInt.addPostActivateDescriptor(lifecycleDesc);
                    break;
                case AROUND_INVOKE :
                    ejbInt.addAroundInvokeDescriptor(lifecycleDesc);
                    break;
                case AROUND_TIMEOUT :
                    ejbInt.addAroundTimeoutDescriptor(lifecycleDesc);
                    break;
                default :
                      throw new IllegalArgumentException("Invalid lifecycle interception type " +
                        interceptionType);
            }
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

        // add the CDI impl-specific system-level interceptor that needs to be registered for ALL
        // EJB components.  At runtime, this sets up the appropriate request context for invocations that
        // do not originate via the web tier.  This interceptor must be registered *before*
        // any application-level interceptors in the chain, so add it in the framework interceptor
        // category within the ejb descriptor.
        EjbInterceptor systemLevelCDIInterceptor = createSystemLevelCDIInterceptor();
        ejbDesc.addFrameworkInterceptor(systemLevelCDIInterceptor);
    }
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

    }
   

    private EjbInterceptor createSystemLevelCDIInterceptor() {

        EjbInterceptor interceptor = new EjbInterceptor();

        Class<SessionBeanInterceptor> interceptorClass = SessionBeanInterceptor.class;

        String interceptorName = interceptorClass.getName();

        interceptor.setInterceptorClass(interceptorClass);

        // @@@ SessionBeanInterceptor.class no longer has @AroundInvoke annotation so
        // we have to look for method explicitly.
        try {
            Method aroundInvokeMethod = interceptorClass.getMethod("aroundInvoke", InvocationContext.class);

            if( aroundInvokeMethod != null ) {
                LifecycleCallbackDescriptor aroundInvokeDesc = new LifecycleCallbackDescriptor();
                aroundInvokeDesc.setLifecycleCallbackClass(interceptorName);
                aroundInvokeDesc.setLifecycleCallbackMethod(aroundInvokeMethod.getName());
                interceptor.addAroundInvokeDescriptor(aroundInvokeDesc);

                // TODO BUG -- Existing SessionBeanInterceptor does not define an @AroundTimeout method.
                // Until that's fixed, work around it by adding the method marked @AroundInvoke as an
                // @AroundTimeout.
                LifecycleCallbackDescriptor aroundTimeoutDesc = new LifecycleCallbackDescriptor();
                aroundTimeoutDesc.setLifecycleCallbackClass(interceptorName);
                aroundTimeoutDesc.setLifecycleCallbackMethod(aroundInvokeMethod.getName());
                interceptor.addAroundTimeoutDescriptor(aroundTimeoutDesc);

                // SessionBeanInterceptor does not define an @PostConstruct method so use the aroundInvoke method
                LifecycleCallbackDescriptor postConstructDesc = new LifecycleCallbackDescriptor();
                postConstructDesc.setLifecycleCallbackClass(interceptorName);
                postConstructDesc.setLifecycleCallbackMethod(aroundInvokeMethod.getName());
                interceptor.addPostConstructDescriptor(postConstructDesc);
            }
        } catch(NoSuchMethodException nsme) {
            throw new RuntimeException("Cannot find weld EJB interceptor aroundInvoke method");
        }
View Full Code Here

Examples of com.sun.enterprise.deployment.EjbInterceptor

    }

    private EjbInterceptor makeEjbInterceptor(Interceptor<?> interceptor, EjbBundleDescriptor bundle) {

        EjbInterceptor ejbInt = new EjbInterceptor();
        ejbInt.setBundleDescriptor(bundle);
        ejbInt.setInterceptorClassName(interceptor.getBeanClass().getName());
        ejbInt.setCDIInterceptor(true);

        return ejbInt;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.