Examples of EjbRequestContext


Examples of org.jboss.weld.context.ejb.EjbRequestContext

                    SecurityActions.setContextClassLoader(classLoader);
                    //it does not matter if this happens twice
                    final BeanManager beanManager = weldContainer.getValue().getBeanManager();
                    final Bean<?> bean = beanManager.resolve(beanManager.getBeans(EjbRequestContext.class, EjbLiteral.INSTANCE));
                    final CreationalContext<?> ctx = beanManager.createCreationalContext(bean);
                    EjbRequestContext requestContext = (EjbRequestContext) beanManager.getReference(bean, EjbRequestContext.class, ctx);
                    interceptor = new EjbRequestScopeActivationInterceptor(requestContext);
                } finally {
                    SecurityActions.setContextClassLoader(tccl);
                }
            }
View Full Code Here

Examples of org.jboss.weld.context.ejb.EjbRequestContext

    public Object aroundInvoke(InvocationContext invocation) throws Exception {

        if (isRequestContextActive()) {
            return invocation.proceed();
        } else {
            EjbRequestContext requestContext = getEjbRequestContext();
            try {
                requestContext.associate(invocation);
                requestContext.activate();
                try {
                    // An event with qualifier @Initialized(RequestScoped.class) is fired when the request context is initialized
                    getBeanManager().getGlobalLenientObserverNotifier().fireEvent(new Object(), InitializedLiteral.REQUEST);
                    return invocation.proceed();
                } finally {
                    requestContext.invalidate();
                    requestContext.deactivate();
                }
            } finally {
                requestContext.dissociate(invocation);
                // An event with qualifier @Destroyed(RequestScoped.class) when the request context is destroyed
                getBeanManager().getGlobalLenientObserverNotifier().fireEvent(new Object(), DestroyedLiteral.REQUEST);
            }
        }
    }
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.