Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.EjbInterceptor


        }
        return false;
    }

    public void addInterceptor(EjbInterceptor interceptor) {
        EjbInterceptor ic =
            getInterceptorByClassName(interceptor.getInterceptorClassName());
        if (ic == null) {
            interceptor.setEjbBundleDescriptor(this);
            interceptors.put(interceptor.getInterceptorClassName(), interceptor);
        }                
View Full Code Here


            }
        }

        if (hasAroundInvokeMethod()) {

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

            aroundInvokeInterceptors.add(interceptorInfo);
        }

        return aroundInvokeInterceptors;
View Full Code Here

            }
        }

        if (hasAroundTimeoutMethod()) {

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

            aroundTimeoutInterceptors.add(interceptorInfo);
        }

        return aroundTimeoutInterceptors;
View Full Code Here

            if (next.getCallbackDescriptors(type).size() > 0) {
                callbackInterceptors.add(next);
            }
        }

        EjbInterceptor beanClassCallbackInfo = null;

        switch (type) {
            case POST_CONSTRUCT:

                if (hasPostConstructMethod()) {
                    beanClassCallbackInfo = new EjbInterceptor();
                    beanClassCallbackInfo.setFromBeanClass(true);
                    beanClassCallbackInfo.addCallbackDescriptors
                            (type, getPostConstructDescriptors());
                }
                break;

            case PRE_DESTROY:

                if (hasPreDestroyMethod()) {
                    beanClassCallbackInfo = new EjbInterceptor();
                    beanClassCallbackInfo.setFromBeanClass(true);
                    beanClassCallbackInfo.addCallbackDescriptors
                            (type, getPreDestroyDescriptors());
                }
                break;

            case PRE_PASSIVATE:

                if (((EjbSessionDescriptor) this).hasPrePassivateMethod()) {
                    beanClassCallbackInfo = new EjbInterceptor();
                    beanClassCallbackInfo.setFromBeanClass(true);
                    beanClassCallbackInfo.addCallbackDescriptors(type,
                            ((EjbSessionDescriptor) this).getPrePassivateDescriptors());
                }

                break;

            case POST_ACTIVATE:

                if (((EjbSessionDescriptor) this).hasPostActivateMethod()) {
                    beanClassCallbackInfo = new EjbInterceptor();
                    beanClassCallbackInfo.setFromBeanClass(true);
                    beanClassCallbackInfo.addCallbackDescriptors(type,
                            ((EjbSessionDescriptor) this).getPostActivateDescriptors());
                }

                break;
               
            default:
                throw new IllegalStateException(localStrings.getLocalString(
                    "enterprise.deployment.invalidcallbacktype",
                    "Invalid callback type: [{0}]", type));
        }

        if (beanClassCallbackInfo != null) {

            beanClassCallbackInfo.setInterceptorClassName
                    (getEjbImplClassName());
            callbackInterceptors.add(beanClassCallbackInfo);

        }
View Full Code Here

    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbInterceptorContext ejbInterceptorContext)
            throws AnnotationProcessorException {

        EjbInterceptor ejbInterceptor =  ejbInterceptorContext.getDescriptor();
        ejbInterceptor.addPostActivateDescriptor(
            getPostActivateDescriptor(ainfo));
        return getDefaultProcessedResult();       
    }
View Full Code Here

    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbInterceptorContext ejbInterceptorContext)
            throws AnnotationProcessorException {

        EjbInterceptor ejbInterceptor =  ejbInterceptorContext.getDescriptor();
        ejbInterceptor.addAroundConstructDescriptor(
            getAroundConstructDescriptor(ainfo));
        return getDefaultProcessedResult();       
    }
View Full Code Here

    }

    protected HandlerProcessingResult processAnnotation(AnnotationInfo ainfo,
            EjbInterceptorContext ejbInterceptorContext)
            throws AnnotationProcessorException {
        EjbInterceptor ejbInterceptor =  ejbInterceptorContext.getDescriptor();
        ejbInterceptor.addPrePassivateDescriptor(
            getPrePassivateDescriptor(ainfo));
        return getDefaultProcessedResult();
    }
View Full Code Here

            if( m.getAnnotation(PrePassivate.class) != null ) {
                prePassivateDescriptors.add(getLifecycleCallbackDescriptor(m));
            }
        }
       
        EjbInterceptor interceptor =
            ejbBundle.getInterceptorByClassName(interceptorClass.getName());
        if (interceptor == null) {
            interceptor = new EjbInterceptor();
            interceptor.setInterceptorClassName(interceptorClass.getName());
            // Add interceptor to the set of all interceptors in the ejb-jar
            ejbBundle.addInterceptor(interceptor);
        }
       
        if (aroundInvokeDescriptors.size() > 0) {
            interceptor.addAroundInvokeDescriptors(aroundInvokeDescriptors);
        }
       
        if (aroundTimeoutDescriptors.size() > 0) {
            interceptor.addAroundTimeoutDescriptors(aroundTimeoutDescriptors);
        }
       
        if (postActivateDescriptors.size() > 0) {
            interceptor.addCallbackDescriptors(CallbackType.POST_ACTIVATE,
                postActivateDescriptors);
        }
       
        if (prePassivateDescriptors.size() > 0) {
            interceptor.addCallbackDescriptors(CallbackType.PRE_PASSIVATE,
                prePassivateDescriptors);
        }

        // process resource related annotations
        EjbInterceptorContext ejbInterceptorContext =
View Full Code Here

        }
        return false;
    }

    public void addInterceptor(EjbInterceptor interceptor) {
        EjbInterceptor ic =
            getInterceptorByClassName(interceptor.getInterceptorClassName());
        if (ic == null) {
            interceptor.setEjbBundleDescriptor(this);
            interceptors.put(interceptor.getInterceptorClassName(), interceptor);
        }                
View Full Code Here

        TranslationResults results = new TranslationResults();       

        if( hasTotalClassLevelOrdering ) {

            for(String next : totalClassLevelOrdering ) {
                EjbInterceptor interceptor =
                    ejbBundle.getInterceptorByClassName(next);
                results.allInterceptorClasses.add(interceptor);
                results.classInterceptorChain.add(interceptor);
            }

        } else {

            for(String next : defaultInterceptorChain) {
                EjbInterceptor interceptor =
                    ejbBundle.getInterceptorByClassName(next);

                results.allInterceptorClasses.add(interceptor);
                results.classInterceptorChain.add(interceptor);
            }

            for(String next : classInterceptorChain) {
                EjbInterceptor interceptor =
                    ejbBundle.getInterceptorByClassName(next);

                results.allInterceptorClasses.add(interceptor);
                results.classInterceptorChain.add(interceptor);
            }
        }

        for(MethodDescriptor nextMethod : methodInterceptorsMap.keySet()) {

            List<String> interceptorClassChain = (List<String>)
                methodInterceptorsMap.get(nextMethod);
           
            List<EjbInterceptor> interceptorChain =
                new LinkedList<EjbInterceptor>();
           
            for(String nextClass : interceptorClassChain) {
                EjbInterceptor interceptor =
                    ejbBundle.getInterceptorByClassName(nextClass);

                results.allInterceptorClasses.add(interceptor);
                interceptorChain.add(interceptor);
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.EjbInterceptor

Copyright © 2018 www.massapicom. 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.