private void preInvoke(WebModule ctx) { WebModule wm = (WebModule)ctx; ComponentInvocation inv = new WebComponentInvocation(wm); invocationMgr.preInvoke(inv); }
public ComponentInvocation startInvocation() { // We need to split the preInvoke tasks into stages since handlers // need access to java:comp/env and method authorization must take // place before handlers are run. Note that the application // classloader was set much earlier when the invocation first arrived // so we don't need to set it here. EjbInvocation inv = container_.createEjbInvocation(); // Do the portions of preInvoke that don't need a Method object. inv.isWebService = true; inv.container = container_; inv.transactionAttribute = Container.TX_NOT_INITIALIZED; // AS per latest spec change, the MessageContext object in WebSvcCtxt // should be the same one as used in the ejb's interceptors' // TODO // inv.setContextData(wsCtxt); // In all cases, the WebServiceInvocationHandler will do the // remaining preInvoke tasks : getContext, preInvokeTx, etc. invManager_.preInvoke(inv); return inv; }
public ComponentInvocation startInvocation() { // We need to split the preInvoke tasks into stages since handlers // need access to java:comp/env and method authorization must take // place before handlers are run. Note that the application // classloader was set much earlier when the invocation first arrived // so we don't need to set it here. EjbInvocation inv = container_.createEjbInvocation(); // Do the portions of preInvoke that don't need a Method object. inv.isWebService = true; inv.container = container_; inv.transactionAttribute = Container.TX_NOT_INITIALIZED; // If the endpoint has at least one handler, method // authorization will be performed by a container-provided handler // before any application handler handleRequest methods are called. // Otherwise, the ejb container will do the authorization. inv.securityPermissions = Container.SEC_NOT_INITIALIZED; // AS per latest spec change, the MessageContext object in WebSvcCtxt // should be the same one as used in the ejb's interceptors' // TODO // inv.setContextData(wsCtxt); // In all cases, the WebServiceInvocationHandler will do the // remaining preInvoke tasks : getContext, preInvokeTx, etc. invManager_.preInvoke(inv); return inv; }
/** * Instantiates and injects the given tag handler class for the given * WebModule */ public <T extends JspTag> T createTagHandlerInstance(WebModule module, Class<T> clazz) throws Exception { WebComponentInvocation inv = new WebComponentInvocation(module); try { invocationMgr.preInvoke(inv); return injectionMgr.createManagedObject(clazz); } finally { invocationMgr.postInvoke(inv); } }
try { previousClassLoader = Utility.setContextClassLoader(clsLoader); invocationManager.preInvoke(componentInvocation);
private void destroyBean(EjbInvocation ejbInv, EJBContextImpl ctx) { if (ejbInv == null) { ejbInv = createEjbInvocation(ctx.getEJB(), ctx); } boolean inTx = false; try { invocationManager.preInvoke(ejbInv); inTx = callLifecycleCallbackInTxIfUsed(ejbInv, ctx, preDestroyInvInfo, CallbackType.PRE_DESTROY); } catch (Throwable t) { _logger.log(Level.FINE, "exception thrown from SFSB PRE_DESTROY", t); } finally { invocationManager.postInvoke(ejbInv); completeLifecycleCallbackTxIfUsed(ejbInv, ctx, inTx); } }
/** * Instantiates and injects the given Servlet class for the given * WebModule */ <T extends Servlet> T createServletInstance(WebModule module, Class<T> clazz) throws Exception { validateJSR299Scope(clazz); WebComponentInvocation inv = new WebComponentInvocation(module); try { invocationMgr.preInvoke(inv); return injectionMgr.createManagedObject(clazz); } finally { invocationMgr.postInvoke(inv); } }
/** * Instantiates and injects the given Filter class for the given * WebModule */ <T extends Filter> T createFilterInstance(WebModule module, Class<T> clazz) throws Exception { validateJSR299Scope(clazz); WebComponentInvocation inv = new WebComponentInvocation(module); try { invocationMgr.preInvoke(inv); return injectionMgr.createManagedObject(clazz); } finally { invocationMgr.postInvoke(inv); } }
/** * Instantiates and injects the given EventListener class for the * given WebModule */ <T extends java.util.EventListener> T createListenerInstance( WebModule module, Class<T> clazz) throws Exception { validateJSR299Scope(clazz); WebComponentInvocation inv = new WebComponentInvocation(module); try { invocationMgr.preInvoke(inv); return injectionMgr.createManagedObject(clazz); } finally { invocationMgr.postInvoke(inv); } }
void beforeCompletion(EJBContextImpl context) { // SessionSync calls on TX_BEAN_MANAGED SessionBeans // are not allowed if( isBeanManagedTran || (beforeCompletionMethod == null) ) { return; } Object ejb = context.getEJB(); // No need to check for a concurrent invocation // because beforeCompletion can only be called after // all business methods are completed. EjbInvocation inv = super.createEjbInvocation(ejb, context); invocationManager.preInvoke(inv); try { transactionManager.enlistComponentResources(); beforeCompletionMethod.invoke(ejb, null); } catch (Exception ex) { // Error during beforeCompletion, so discard bean: EJB2.0 18.3.3 try { forceDestroyBean(context); } catch (Exception e) { _logger.log(Level.FINE, "error destroying bean", e); } throw new EJBException("Error during SessionSynchronization." + "beforeCompletion, EJB instance discarded", ex); } finally { invocationManager.postInvoke(inv); } }
Object ejb = context.getEJB(); EjbInvocation ejbInv = createEjbInvocation(ejb, context); invocationManager.preInvoke(ejbInv); try { context.setInAfterCompletion(true);
Object ejb = context.getEJB(); EjbInvocation ejbInv = createEjbInvocation(ejb, context); invocationManager.preInvoke(ejbInv); try { context.setInAfterCompletion(true);
invocationManager.preInvoke(inv);
invocationManager.preInvoke(inv); try { transactionManager.enlistComponentResources();
invocationManager.preInvoke(ejbInv);
invocationManager.preInvoke(inv);
EjbInvocation inv = super.createEjbInvocation(ejb, context); inv.method = ejbPassivateMethod; invocationManager.preInvoke(inv);
private void enlistResourcesAndStore(EntityContextImpl context) { EntityBean e = (EntityBean)context.getEJB(); // NOTE : Use EjbInvocation instead of ComponentInvocation since // the context is available. It is needed in case ejbStore/ejbLoad // makes use of EJB timer service in order to perform operations allowed // checks EjbInvocation inv = super.createEjbInvocation(e, context); invocationManager.preInvoke(inv); try { transactionManager.enlistComponentResources(); callEJBStore(e, context); } catch ( NoSuchEntityException ex ) { // Error during ejbStore, so discard bean: EJB2.0 18.3.3 forceDestroyBean(context); throw new NoSuchObjectLocalException( "NoSuchEntityException thrown by ejbStore, EJB instance discarded", ex); } catch ( Exception ex ) { // Error during ejbStore, so discard bean: EJB2.0 18.3.3 forceDestroyBean(context); throw new EJBException(ex); } finally { invocationManager.postInvoke(inv); } }
invocationManager.preInvoke(invocation);
private void afterInstanceCreation(SessionContextImpl context) throws Exception { context.setState(BeanState.READY); EjbInvocation ejbInv = null; try { // Need to do preInvoke because setSessionContext can access JNDI ejbInv = super.createEjbInvocation(context.getEJB(), context); invocationManager.preInvoke(ejbInv); // PostConstruct must be called after state set to something // other than CREATED interceptorManager.intercept(CallbackType.POST_CONSTRUCT, context); } catch (Throwable t) { EJBException ejbEx = new EJBException(); ejbEx.initCause(t); throw ejbEx; } finally { if (ejbInv != null) { invocationManager.postInvoke(ejbInv); } } ejbProbeNotifier.ejbBeanCreatedEvent(getContainerId(), containerInfo.appName, containerInfo.modName, containerInfo.ejbName); incrementMethodReadyStat(); }