Package com.sun.enterprise.deployment

Examples of com.sun.enterprise.deployment.LifecycleCallbackDescriptor


    public Class<? extends Annotation>[] getTypeDependencies() {
        return getEjbAnnotationTypes();
    }

    private LifecycleCallbackDescriptor getLifecycleCallbackDescriptor(Method m) {
        LifecycleCallbackDescriptor lccDesc = new LifecycleCallbackDescriptor();
        lccDesc.setLifecycleCallbackClass(m.getDeclaringClass().getName());
        lccDesc.setLifecycleCallbackMethod(m.getName());
        return lccDesc;
    }
View Full Code Here


    }

    private LifecycleCallbackDescriptor getPostActivateDescriptor(
            AnnotationInfo ainfo) {
        Method annotatedMethod = (Method) ainfo.getAnnotatedElement();
        LifecycleCallbackDescriptor postActivate =
                new LifecycleCallbackDescriptor();
        postActivate.setLifecycleCallbackClass(annotatedMethod.getDeclaringClass().getName());
        postActivate.setLifecycleCallbackMethod(annotatedMethod.getName());
        return postActivate;
    }
View Full Code Here

        Method annMethod = (Method)ainfo.getAnnotatedElement();
        String pdMethodName = annMethod.getName();
        String pdClassName = annMethod.getDeclaringClass().getName();

        for (ResourceContainerContext rcContext : rcContexts) {
            LifecycleCallbackDescriptor preDestroyDesc =
                   new LifecycleCallbackDescriptor();
            preDestroyDesc.setLifecycleCallbackClass(pdClassName);
            preDestroyDesc.setLifecycleCallbackMethod(pdMethodName);
            // override by xml is handled in addPreDestroyDescriptor
            rcContext.addPreDestroyDescriptor(preDestroyDesc);
        }

        return getDefaultProcessedResult();
View Full Code Here

        Method annMethod = (Method)ainfo.getAnnotatedElement();
        String pcMethodName = annMethod.getName();
        String pcClassName = annMethod.getDeclaringClass().getName();

        for (ResourceContainerContext rcContext : rcContexts) {
            LifecycleCallbackDescriptor postConstructDesc =
                   new LifecycleCallbackDescriptor();
            postConstructDesc.setLifecycleCallbackClass(pcClassName);
            postConstructDesc.setLifecycleCallbackMethod(pcMethodName);
            // override by xml is handled in addPostConstructDescriptor
            rcContext.addPostConstructDescriptor(postConstructDesc);
        }

        return getDefaultProcessedResult();
View Full Code Here

    private LifecycleCallbackDescriptor getAroundInvokeDescriptor(
            AnnotationInfo ainfo) {
       
        Method m = (Method) ainfo.getAnnotatedElement();
        LifecycleCallbackDescriptor lccDesc =
                new LifecycleCallbackDescriptor();
        lccDesc.setLifecycleCallbackClass(m.getDeclaringClass().getName());
        lccDesc.setLifecycleCallbackMethod(m.getName());
        return lccDesc;
    }
View Full Code Here

    * @return the descriptor instance to associate with this XMLNode
    */      
    public Object getDescriptor() {
       
       if (descriptor==null) {
            descriptor = new LifecycleCallbackDescriptor();
            Descriptor parentDesc =
                (Descriptor)getParentNode().getDescriptor();
            if (parentDesc instanceof EjbDescriptor) {
                EjbDescriptor ejbDesc = (EjbDescriptor)parentDesc;
                descriptor.setDefaultLifecycleCallbackClass(
View Full Code Here

        }

        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);
View Full Code Here

        // 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

    public Class<? extends Annotation>[] getTypeDependencies() {
        return getEjbAnnotationTypes();
    }

    private LifecycleCallbackDescriptor getLifecycleCallbackDescriptor(Method m) {
        LifecycleCallbackDescriptor lccDesc = new LifecycleCallbackDescriptor();
        lccDesc.setLifecycleCallbackClass(m.getDeclaringClass().getName());
        lccDesc.setLifecycleCallbackMethod(m.getName());
        return lccDesc;
    }
View Full Code Here

        // 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);
            }
        } catch(NoSuchMethodException nsme) {
            throw new RuntimeException("Cannot find weld EJB interceptor aroundInvoke method");
        }
View Full Code Here

TOP

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

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.