public void postInvokeForLifecycleInterceptors(LifecycleInterceptorWrapper wrapper,
                                                   int methodId,
                                                   EJSDeployedSupport s) throws RemoteException {
        // NOTE: The implementation of this method is structured after postInvoke.
        // For a detailed explanation of the operations here, see the comments in
        // that method.

        EJBMethodInfoImpl methodInfo = s.methodInfo;

        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn) {
            if (TEEJBInvocationInfo.isTraceEnabled())
                TEEJBInvocationInfo.tracePostInvokeBegins(s, wrapper);

            if (tcClntInfo.isDebugEnabled())
                Tr.debug(tcClntInfo, "postInvoke(" + methodInfo.getMethodName() + ")");

            if (tc.isEntryEnabled())
                Tr.entry(tc, "postInvokeForLifecycleInterceptors(" + methodId +
                             ":" + methodInfo.getMethodName() + ")");
        }

        // UOWManager.runUnderUOW may have left cached currentTx invalid; reset
        if (s.resetCurrentTx) {
            if (isTraceOn && tc.isDebugEnabled())
                Tr.debug(tc, "s.currentTx may be invalid; reset");
            s.currentTx = getCurrentContainerTx();
        }

        s.currentTx.postInvoke(s);

        try {
            boolean isRollbackOnly = uowCtrl.getRollbackOnly(); //d636725
            try {
                if (s.began && s.currentTx.ivPostInvokeContext == null) {
                    s.currentTx.ivPostInvokeContext = s;
                }

                uowCtrl.postInvoke(wrapper.beanId, s.uowCookie, s.exType, methodInfo);
            } catch (CSITransactionRolledbackException ex) {
                // Per preInvokeForLifecycleInterceptors, all exceptions thrown from
                // lifecycle interceptors must not be application exceptions.  This
                // ensures postInvokeRolledbackException will propagate this exception
                // (unless setRollbackOnly was called).  The exception is mapped to
                // prevent application code from seeing internal CSIExceptions.
                postInvokeRolledbackException(s, ex);
            }

            //d636725 start
            // If setRollbackOnly was called in a PostConstruct method of a
            // singleton bean, then we need to throw an
            // EJBTransactionRolledBackException here which will be wrapped
            // in a NoSuchEJBException.
            // Our interpretation of the spec requires that we throw this
            // exception here (as opposed to within the setRollbackOnly
            // method - which is an allowed operation) so that the the
            // NoSuchEJBException will be thrown to the client during
            // postInvoke. This behavior is specific to Singleton beans
            // as Stateful and Stateless beans are not allowed to call
            // setRollbackOnly inside PostConstruct methods - they would
            // receive an IllegalStateException.
            if (methodId == LifecycleInterceptorWrapper.MID_POST_CONSTRUCT &&
                isRollbackOnly) {

                String msg = "setRollbackOnly called from within a singleton post construct method.";
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, msg);
                throw new EJBTransactionRolledbackException(msg);
            }
            //d636725 end
        } finally {
            if (!s.began || s.currentTx.ivPostInvokeContext != null) {
                postInvokePopCallbackContexts(s);
            }

            if (s.ivSecurityCollaborator != null) {
                notifyPostInvoke(s.ivSecurityCollaborator, s, s.securityCookie);
            }

            if (s.currentTx != null && s.began) {
                s.currentTx.releaseResources();
                s.currentTx = null;
            }

            EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(s.oldClassLoader);

            s.ivThreadData.popMethodContext(); // d646139.1, RTC102449

            if (isTraceOn) {
                if (tc.isEntryEnabled())
                    Tr.exit(tc, "postInvokeForLifecycleInterceptors(" + methodId + ":" +
                                methodInfo.getMethodName() + ")" +
                                ((s.ivException != null) ? ("**** throws " + s.ivException) : ""));
            }
        }
    }
public void postInvokeForLifecycleInterceptors ( LifecycleInterceptorWrapper wrapper , int methodId , EJSDeployedSupport s ) throws RemoteException { EJBMethodInfoImpl methodInfo = s . methodInfo ; final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn ) { if ( TEEJBInvocationInfo . isTraceEnabled ( ) ) TEEJBInvocationInfo . tracePostInvokeBegins ( s , wrapper ) ; if ( tcClntInfo . isDebugEnabled ( ) ) Tr . debug ( tcClntInfo , "postInvoke(" + methodInfo . getMethodName ( ) + ")" ) ; if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "postInvokeForLifecycleInterceptors(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" ) ; } if ( s . resetCurrentTx ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "s.currentTx may be invalid; reset" ) ; s . currentTx = getCurrentContainerTx ( ) ; } s . currentTx . postInvoke ( s ) ; try { boolean isRollbackOnly = uowCtrl . getRollbackOnly ( ) ; try { if ( s . began && s . currentTx . ivPostInvokeContext == null ) { s . currentTx . ivPostInvokeContext = s ; } uowCtrl . postInvoke ( wrapper . beanId , s . uowCookie , s . exType , methodInfo ) ; } catch ( CSITransactionRolledbackException ex ) { postInvokeRolledbackException ( s , ex ) ; } if ( methodId == LifecycleInterceptorWrapper . MID_POST_CONSTRUCT && isRollbackOnly ) { String msg = "setRollbackOnly called from within a singleton post construct method." ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , msg ) ; throw new EJBTransactionRolledbackException ( msg ) ; } } finally { if ( ! s . began || s . currentTx . ivPostInvokeContext != null ) { postInvokePopCallbackContexts ( s ) ; } if ( s . ivSecurityCollaborator != null ) { notifyPostInvoke ( s . ivSecurityCollaborator , s , s . securityCookie ) ; } if ( s . currentTx != null && s . began ) { s . currentTx . releaseResources ( ) ; s . currentTx = null ; } EJBThreadData . svThreadContextAccessor . popContextClassLoaderForUnprivileged ( s . oldClassLoader ) ; s . ivThreadData . popMethodContext ( ) ; if ( isTraceOn ) { if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "postInvokeForLifecycleInterceptors(" + methodId + ":" + methodInfo . getMethodName ( ) + ")" + ( ( s . ivException != null ) ? ( "**** throws " + s . ivException ) : "" ) ) ; } } }
A subset of postInvoke specifically for the lifecycle interceptors of a
Singleton Session bean. This method must be paired with
preInvokeForLifecycleInterceptors.