Resource adapter calls this method after a message
is delivered and processed by an MDB instance.
<p>
<dl>
<dt>
<b>pre-condition</b>
<dd>
Caller ensures this method is only called from the Thread
that called beforeDelivery method.
</dl>
432739
@Override
    public void afterDelivery() throws ResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        {
            Tr.entry(tc, "MessageEndpoint.afterDelivery");
        }

        if (!ivSkipCheckState) {
            //method param for checkState can be null since it's only used when the method is a MDB_BUSINESS_METHOD
            checkState(-1, null, AFTER_DELIVERY_METHOD);
        }

        try
        {
            if (ivRollbackOnly) // f743-7046
            {
                ContainerTx currentTx = ivEJSDeployedSupport.getCurrentTx();
                if (currentTx != null) // d629697
                {
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    {
                        Tr.debug(tc, "calling setRollbackOnly");
                    }
                    currentTx.setRollbackOnly(); // f743-7046
                }
            }

            // The container postInvoke will complete the TX if the TX is
            // not an imported global TX. Rollback occurs if setRollbackOnly
            // was invoked on the current TX.
            container.postInvoke(this, ivMethodId, ivEJSDeployedSupport);
        } catch (Throwable e)
        {
            //FFDCFilter.processException(e, CLASS_NAME + ".afterDelivery", "1280", this);
            // f743-7046 start
            if (!ivRollbackOnly) // f743-7046
            {
                FFDCFilter.processException(e, CLASS_NAME + ".afterDelivery", "1280", this);
                throw new ResourceException("afterDelivery failure", e);
            }
            else
            {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                {
                    Tr.debug(tc, "MessageEndpoint.afterDelivery is eating Throwable: " + e.getMessage()
                                 + " since " + majorJCAVersion + "." + minorJCAVersion + " requires abort of TX and no exceptions to be thrown.", e);
                }
            } // f743-7046 end
        } finally
        {
            // Release objects no longer needed and ensure the
            // rollback only and imported TX flags are reset to false.
            ivRollbackOnly = false; // f743-7046
            ivImportedTx = false; // f743-7046
            ivEJSDeployedSupport = null;
            ivMDB = null;
            ivMethod = null;

            // Enter the ready state.
            synchronized (this)
            {
                ivState = READY_STATE;
                ivThread = null;
            }

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            {
                Tr.exit(tc, "MessageEndpoint.afterDelivery");
            }
        }
    }
1168886
public void preInvokeMdbAfterActivate(EJSWrapperBase wrapper,
                                          EJSDeployedSupport s,
                                          Object eb, // d414873
                                          Object[] args) throws RemoteException {
        // Now perform preinvoke processing that must occur after
        // the bean is activated.
        preInvokeAfterActivate(wrapper, eb, s, args);

        // If there is a registered message endpoint collaborator, call it for preInvoke processing.
        MessageEndpointCollaborator meCollaborator = getEJBRuntime().getMessageEndpointCollaborator(wrapper.bmd);
        if (meCollaborator != null) {
            HashMap<String, Object> contextData = new HashMap<String, Object>();
            contextData.put(MessageEndpointCollaborator.KEY_ACTIVATION_SPEC_ID, wrapper.bmd.ivActivationSpecJndiName);
            contextData.put(MessageEndpointCollaborator.KEY_J2EE_NAME, wrapper.bmd.j2eeName);

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
                Tr.debug(tc, "Invoking MECollaborator " + meCollaborator + " for preInvoke processing with the following context data: " + contextData);
            }
            
            s.messageEndpointContext = meCollaborator.preInvoke(contextData);
        }

        // Normal path exit.
        if (TraceComponent.isAnyTracingEnabled()) {
            if (tc.isEntryEnabled()) {
                int methodId = s.methodId;
                EJBMethodInfoImpl methodInfo = s.methodInfo;
                ContainerTx containerTx = s.currentTx;
                Tr.exit(tc, "EJBpreInvoke(" + methodId + ":" +
                            methodInfo.getMethodName() + ") " +
                            " Invoking method '" + methodInfo.getMethodName() +
                            "' on bean '" + wrapper.getClass().getName() +
                            "(" + wrapper.beanId + ")" +
                            "', '" + containerTx + "', isGlobalTx=" +
                            (containerTx != null ? (containerTx.isTransactionGlobal() ? "true" : "false") : "Unknown"));
            }

            if (TEEJBInvocationInfo.isTraceEnabled())
                TEEJBInvocationInfo.tracePreInvokeEnds(s, wrapper);
        }
    }
804825
@Override
    public Object preInvoke() throws SecurityViolationException {
        Subject invokedSubject = subjectManager.getInvocationSubject();
        Subject receivedSubject = subjectManager.getCallerSubject();

        subjectManager.clearSubjects();

        return null;
    }
857038
private void reconstituteLocalQueuePoint(int startMode,
                                             boolean isSystem)
                    throws MessageStoreException, SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc,
                        "reconstituteLocalQueuePoint",
                        new Object[] {
                                      Integer.valueOf(startMode),
                                      Boolean.valueOf(isSystem),
                                      this });

        int localisationCount = 0;
        PtoPLocalMsgsItemStream ptoPLocalMsgsItemStream = null;

        // There can be one or more localisations in the BaseDestinationHandler.
        NonLockingCursor cursor =
                        _baseDestinationHandler.newNonLockingItemStreamCursor(
                                        new ClassEqualsFilter(PtoPLocalMsgsItemStream.class));

        do
        {
            ptoPLocalMsgsItemStream = (PtoPLocalMsgsItemStream) cursor.next();
            if (ptoPLocalMsgsItemStream != null)
            {
                ptoPLocalMsgsItemStream.reconstitute(_baseDestinationHandler);
                if (ptoPLocalMsgsItemStream.isToBeDeleted())
                {
                    ptoPLocalMsgsItemStream.setDeleteRequiredAtReconstitute(true);
                    //clean this up when we get a chance
                    _postMediatedItemStreamsRequiringCleanup.put(
                                                                 _messageProcessor.getMessagingEngineUuid(), ptoPLocalMsgsItemStream);
                    _baseDestinationHandler.setHasReconciledStreamsToBeDeleted(true);
                }
                else
                {
                    localisationCount++;
                    attachLocalPtoPLocalisation(ptoPLocalMsgsItemStream);

                    /* Feature 176658.3.2 */
                    assignQueuePointOutputHandler(
                                                  ptoPLocalMsgsItemStream.getOutputHandler(),
                                                  ptoPLocalMsgsItemStream.getLocalizingMEUuid());
                    ConsumerDispatcher consumerDispatcher =
                                    (ConsumerDispatcher) ptoPLocalMsgsItemStream.getOutputHandler();
                    consumerDispatcher.setReadyForUse();

                    //Restore the guess sets for system destinations
                    if (isSystem)
                    {
                        _localisationManager.addMEToQueuePointGuessSet(_pToPLocalMsgsItemStream.getLocalizingMEUuid());
                        ptoPLocalMsgsItemStream.
                                        updateLocalizationDefinition(_messageProcessor.
                                                        createLocalizationDefinition(_baseDestinationHandler.getName()));
                    }
                }
            }
        } while (ptoPLocalMsgsItemStream != null);

        cursor.finished();

        // also check if there is an AOContainerItemStream for Remote Get
        int aoCount = _remoteSupport.reconstituteLocalQueuePoint(startMode);

        // Sanity - There should never be more than one local msgs itemstream
        // or more than one aoContainerItemStream
        if ((localisationCount > 1) || (aoCount > 1))
        {
            SIErrorException e =
                            new SIErrorException(
                                            nls.getFormattedMessage(
                                                                    "INTERNAL_MESSAGING_ERROR_CWSIP0005",
                                                                    new Object[] {
                                                                                  "com.ibm.ws.sib.processor.impl.destination.JSPtoPRealization",
                                                                                  "1:595:1.24.1.7",
                                                                                  _baseDestinationHandler.getName() },
                                                                    null));

            FFDCFilter.processException(
                                        e,
                                        "com.ibm.ws.sib.processor.impl.destination.JSPtoPRealization.reconstituteLocalQueuePoint",
                                        "1:560:1.24.1.25",
                                        this);

            SibTr.exception(tc, e);
            SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0005",
                        new Object[] {
                                      "com.ibm.ws.sib.processor.impl.destination.JSPtoPRealization",
                                      "1:567:1.24.1.25",
                                      _baseDestinationHandler.getName() });

            if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                SibTr.exit(tc, "reconstituteLocalQueuePoint", e);

            throw e;
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "reconstituteLocalQueuePoint");
    }
1287665
@Override
    public void onAfterSent(ChannelContext channelContext, Packet packet, boolean isSentSuccess) throws Exception {
        log.debug("消息包发送之后触发onAfterSent");
    }
1125896
public void call(Message mesg, String interactionId, String btxnName) {
        boolean activated = collector.session().activate(uri, null, interactionId);

        if (activated) {
            collector.consumerStart(null, uri, "Test", null, interactionId);
            collector.setTransaction(null, btxnName);
        }

        if (calledServices != null) {
            String calledServiceName = calledServices.get(mesg.getType());

            // Introduce a delay related to the business logic
            synchronized (this) {
                try {
                    wait(((int) Math.random() % 300) + 50);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

            if (calledServiceName != null) {
                Service calledService = registry.getServiceInstance(calledServiceName);

                String nextInteractionId = UUID.randomUUID().toString();

                if (activated) {
                    collector.producerStart(null, calledService.getUri(), "Test", null, nextInteractionId);
                }

                // Introduce a delay related to the latency
                synchronized (this) {
                    try {
                        wait(((int) Math.random() % 100) + 10);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }

                calledService.call(mesg, nextInteractionId, collector.getTransaction());

                if (activated) {
                    collector.producerEnd(null, calledService.getUri(), "Test", null);
                }
            }
        }

        if (activated) {
            collector.consumerEnd(null, uri, "Test", null);
        }

        setLastUsed(System.currentTimeMillis());

        // Return instance to stack
        registry.returnServiceInstance(this);
    }
785067
protected void threadBegin() {
        //
        // Note the 'beforeCallbacks' list is not going to have a well-defined order, so it is of limited use.
        // We probably want to revisit this with some kind of priority/order based on ranking to make
        // it more useful.
        //
        // At the moment we treat the setting of the tran timeout separately, rather than as a IJobExecutionStartCallbackService,
        // to reflect the fact that this is provided by a required dependency.  If we were to want this to function in SE mode,
        // say, we might want to factor this too as an "extension" that is provided by another layer, and so incorporate this into a
        // more generic, extensible "before" processing.
        try {
            tranMgr.setTransactionTimeout(0);
            if (beforeCallbacks != null) {
                for (IJobExecutionStartCallbackService callback : beforeCallbacks) {
                    if (logger.isLoggable(Level.FINER)) {
                        logger.logp(Level.FINER, CLASSNAME, "threadBegin", "Calling before callback", callback);
                    }
                    callback.jobStarted(runtimeWorkUnitExecution);
                }
            }
        } catch (Throwable t) {
            // Fail the execution if any of our before-work-unit callbacks failed. E.g. the joblog context setup
            // was unsuccessful. We may want to make it an option whether or not to fail here in the future.
            runtimeWorkUnitExecution.logExecutionFailedMessage();
            throw new BatchContainerRuntimeException("An error occurred during thread initialization.", t);
        }
    }
871227
@Override
	protected void doExecute() {
		Predicate<MailMessage> condition = createMessagePredicate();
		List<MailMessage> messages = mailService.findMessages(accountReservationKey, condition, getExpectedMessagesCount());
		validateMessages(messages);
	}
346825
@Override
    public void beforeCompletion() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { 
            Tr.entry(this, tc, "beforeCompletion");
            Tr.exit(this, tc, "beforeCompletion");
        }
    }
348858
protected void preInvoke(Method m, Object [] args, String [] interceptorNames)
        throws InterceptorPivotException
    {
        //
        // If the implementation expects single threaded behavior and our container does
        // not guarantee it, then enforce it locally here
        //
        if (_invokeLock != null)
        {
            try { _invokeLock.acquire(); } catch (InterruptedException ie) { }
        }

        //
        // Process interceptors
        //
        if ( interceptorNames != null )
        {
            for ( String n : interceptorNames )
            {
                Interceptor i = ensureInterceptor( n );
                try
                {
                    i.preInvoke( this, m, args );
                }
                catch (InterceptorPivotException ipe)
                {
                    ipe.setInterceptorName(n);
                    throw ipe;
                }
            }
        }

        Vector<InvokeListener> invokeListeners = getInvokeListeners();
        if (invokeListeners.size() > 0)
        {
            for (InvokeListener listener : invokeListeners)
                listener.preInvoke(m, args);
        }
    }
173714
public void processThisMessage()
    {
        Utility.getLogger().info("On message called in receiving process");
        try {
            BaseMessage messageIn = this.getMessage();
            if (messageIn != null)
            {
                BaseMessage messageReply = this.createReplyMessage(messageIn);
                this.moveScreenParamsToMessage(messageReply);
                // Step 2 - Get the body part of the message
                this.getTransport().setupReplyMessage(messageReply, messageIn, MessageInfoTypeModel.REPLY, MessageTypeModel.MESSAGE_IN);
            
                this.getTransport().processIncomingMessage(messageReply, null);
            }
        } catch(Exception ex) {
            ex.printStackTrace();
            Debug.print(ex, "Error in processing or replying to a message");
        }
    }
1037118
public void beforeMethodHook(String hookedClassQualifiedName,
            String hookedMethodSimpleName, String actualHookedMethodSimpleName) {
        if (currentRunResult != null) {
            return; // maybe called inside of the root method
        }

        List<TestMethod> rootMethods = srcTree.getRootMethodTable().getByName(
                hookedClassQualifiedName, hookedMethodSimpleName);
        if (rootMethods.size() == 0) {
            return; // hooked method is not root method
        }
        assert rootMethods.size() == 1;
        TestMethod rootMethod = rootMethods.get(0);

        logger.info("beforeMethodHook: " + hookedMethodSimpleName);

        // initialize current captureNo and runResult
        currentCaptureNo = 1;
        currentRunResult = new RootMethodRunResult();
        currentRunResult.setRootMethodKey(rootMethod.getKey());
        currentRunResult.setRootMethod(rootMethod);
        currentActualRootMethodSimpleName = actualHookedMethodSimpleName;

        startMethodTime = System.currentTimeMillis();
    }
408476
@Override
    public void setDeliveryDelay(long deliveryDelayTime) throws JMSException {

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "setDeliveryDelay", deliveryDelayTime);

        checkClosed();
        // Throws an exception if this is not a valid time to live.
        validateDeliveryDelayTime(deliveryDelayTime);
        // We know by this point that it must be valid.
        this.defaultDeliveryDelay = deliveryDelayTime;

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "setDeliveryDelay");

    }
1249910
private synchronized void onContextReady(final ContextStatusPOJO contextStatus,
                                           final boolean notifyClientOnNewActiveContext) {
    assert ContextState.READY == contextStatus.getContextState();
    final String contextID = contextStatus.getContextId();
    // This could be the first message we get from that context
    if (this.isUnknownContextId(contextID)) {
      this.onNewContext(contextStatus, notifyClientOnNewActiveContext);
    }

    // Dispatch the messages to the application, if there are any.
    for (final ContextMessagePOJO
             contextMessage : contextStatus.getContextMessageList()) {
      final byte[] theMessage = contextMessage.getMessage();
      final String sourceID = contextMessage.getSourceId();
      final long sequenceNumber = contextMessage.getSequenceNumber();
      this.messageDispatcher.onContextMessage(new ContextMessageImpl(theMessage, contextID, sourceID, sequenceNumber));
    }

  }
93529
public void preInvoke( InterceptorContext context, InterceptorChain chain ) throws InterceptorException
    {
        preRequest( ( RequestInterceptorContext ) context, chain );
    }
1301576
@Override
    public void beforeCompletion()
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        if (isTraceOn) // d527372
        {
            if (tc.isEntryEnabled())
                Tr.entry(tc, "beforeCompletion",
                         new Object[]
                         { Boolean.valueOf(globalTransaction),
                          this,
                          Boolean.valueOf(isActivitySessionCompleting) });

            if (TETxLifeCycleInfo.isTraceEnabled()) // PQ74774
            { // PQ74774
                String tid = getTxId();
                if (tid != null)
                {
                    if (globalTransaction)
                    {
                        TETxLifeCycleInfo.traceGlobalTxBeforeCompletion
                                        (tid, "Global/User Tx BeforeCompletion");
                    } else
                    {
                        TETxLifeCycleInfo.traceLocalTxBeforeCompletion
                                        (tid, "Local Tx BeforeCompletion");
                    }
                }
            } // PQ74774
        }

        //d139562.11
        if (finderSyncList != null) // d173022.12
        { // d173022.12
            int numberofCallers = finderSyncList.size();
            for (int i = 0; i < numberofCallers; ++i) {
                finderSyncList.get(i).beforeCompletion();
            }
        } // d173022.12

        if (ivBeanOsEnlistedInTx)
        {
            //d173022.2
            origLock = true;//d115597 set the origLock flag to true because beforeCompletion entered

            EJBThreadData threadData = EJSContainer.getThreadData(); // d630940
            BeanO beanO = null;
            boolean popCallbackBeanO = false;
            ComponentMetaData prevCMD = null;
            boolean resetCMD = false;
            ClassLoader prevClassLoader = null;
            Object origClassLoader = ThreadContextAccessor.UNCHANGED;

            try
            {
                // Process beans in a loop to allow beforeCompletion callbacks to
                // enlist additional beans.  We limit the number of iterations to
                // detect infinite loops.                                      d115597
                int iterationCount = 0;
                for (ArrayList<BeanO> iterationBeanOs = beanOList; iterationBeanOs != null; iterationBeanOs = tempList, tempList = null)
                {
                    if (iterationCount++ > MAX_ENLISTMENT_ITERATIONS)
                    {
                        beanO = null;
                        throw new RuntimeException("Exceeded " + MAX_ENLISTMENT_ITERATIONS + " enlistment iterations in beforeCompletion");
                    }

                    //--------------------------------------------------------------
                    // d115597
                    // Imposes an order in which the beforeCompletion callbacks
                    // will be fired on the beans.
                    // beforeCompletion is called on beans in the order they were
                    // enlisted.  This is true for beans enlisted after beforeCompletion
                    // has begun as well.
                    // d115597
                    //--------------------------------------------------------------

                    for (int i = 0, size = iterationBeanOs.size(); i < size; i++)
                    {
                        beanO = iterationBeanOs.get(i);
                        BeanMetaData bmd = beanO.home.beanMetaData;

                        // Process all beans if the activity session is completing.
                        // Only process entity beans if this is a checkpoint.
                        //
                        // d126930.3
                        // By default isActivitySessionCompleting is set to true even if there
                        // is no activitySession present.  This simply means we follow the normal
                        // ContainerTx logic for ending a transaction.
                        if (isActivitySessionCompleting || bmd.isEntityBean())
                        {
                            // Update the thread callback bean.
                            threadData.pushCallbackBeanO(beanO); // d168509, d630940
                            popCallbackBeanO = true;

                            // Update the thread CMD if it's not the same as the
                            // previous bean.
                            if (bmd != prevCMD)
                            {
                                if (resetCMD)
                                {
                                    cmdAccessor.endContext();
                                }

                                cmdAccessor.beginContext(bmd);
                                prevCMD = bmd;
                                resetCMD = true;

                                // Update the class loader if it's not the same as the
                                // previous bean.                         PK51366, PK83186
                                ClassLoader classLoader = bmd.ivContextClassLoader; // F85059
                                if (classLoader != prevClassLoader)
                                {
                                    prevClassLoader = classLoader;
                                    origClassLoader = EJBThreadData.svThreadContextAccessor.repushContextClassLoaderForUnprivileged(origClassLoader, classLoader);
                                }
                            }

                            // d126930.3
                            // EJB 2.0 beans may have sticky local transactions (i.e.
                            // local tx boundary = ActivitySession).  We need to assure
                            // the correct ComponentMetaData and local tx context is
                            // on thread in this case.  Note that EJB 1.1 beans may not
                            // have local tx boundary = ActivitySession.  This is enforced
                            // by a check in BeanMetaData
                            if (isActivitySessionCompleting &&
                                (globalTransaction ||
                                bmd._localTran.getBoundary() == LocalTransactionSettings.BOUNDARY_ACTIVITY_SESSION))
                            {
                                beanO.beforeCompletion();
                            }
                            else
                            {
                                TxContextChange changedContext = uowCtrl.setupLocalTxContext(beanO.getId());
                                try
                                {
                                    if (isActivitySessionCompleting)
                                    {
                                        beanO.beforeCompletion();
                                    }
                                    else
                                    {
                                        //-------------------------------------------------------------
                                        // Special case added for mid-activitySession checkpoint.
                                        // Entity beans enlisted in local transactions must be stored
                                        // to flush any in-memory updates out to the backing store
                                        // (ie. checkpoint them).  For other bean types, we do
                                        // nothing on mid-activitySession checkpoint.  The local
                                        // transaction service will make setCompleting = false calls to
                                        // the containerSynchronization interface at checkpoint.  Also,
                                        // beforeCompletion and afterCompletion will be called.  We
                                        // have special code both here, and in afterCompletion, so that
                                        // the beans' states do not change.  We just store them.
                                        // ------------------------------------------------------------
                                        beanO.store();
                                    }
                                } finally
                                {
                                    uowCtrl.teardownLocalTxContext(changedContext);
                                }
                            }

                            popCallbackBeanO = false;
                            threadData.popCallbackBeanO();
                        }
                    }
                }
            } catch (Throwable t)
            {

                FFDCFilter.processException(t, CLASS_NAME + ".beforeCompletion",
                                            "562", this);
                if (isTraceOn && tc.isEventEnabled()) // d144064
                    Tr.event(tc, "Exception during beforeCompletion(): rolling back",
                             new Object[] { beanO, t });

                // Destroy the beanO, too late to delist. Destroying it should
                // take care of the state when the transaction is rolled back.
                // Note there may not be a beanO, if the exception is container
                // detecting a loop condition - not a bean exception.     d160910
                if (beanO != null)
                    beanO.destroy();

                ivContainer.uowCtrl.setRollbackOnly();

                // Log the exception
                ExceptionUtil.logException(tc, t, null, beanO);

                // Save the first exception that occurs during commit
                // processing to nest in TransactionRolledBackException.  PQ90221
                if (ivPostProcessingException == null)
                    ivPostProcessingException = t;

                // Inform the transaction manager that the beforeCompletion
                // failed. Else, the tran engine might continue to fire
                // beforeCompletion callbacks on other participants
                throw new RuntimeException("", t); //253963

            } finally
            {
                EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(origClassLoader);

                if (resetCMD)
                {
                    cmdAccessor.endContext();
                }

                if (popCallbackBeanO)
                {
                    threadData.popCallbackBeanO();
                }
            }
        }

        if (isActivitySessionCompleting)
        {
            //--------------------------------------------------------------
            // The before completion callbacks on the beans may result
            // in more beans getting enlisted in this transaction, so we don't
            // change the state to PREPARING until all beans are prepared.
            //--------------------------------------------------------------
            becomePreparing();
        }

        // Now that all of the beans have been successfully stored, call
        // before completion on the PM transaction listener.           d134692
        if (txListener != null) {
            try {
                if (isTraceOn && tc.isDebugEnabled()) // d144064
                    Tr.debug(tc, "Calling txListener.beforeCompletion()");
                txListener.beforeCompletion();
            } catch (Throwable e) {
                FFDCFilter.processException(e, CLASS_NAME + ".beforeCompletion",
                                            "734", this);

                if (ivPostProcessingException == null) { //253963
                    ivPostProcessingException = e; //253963
                }
                throw new RuntimeException("txListener exception" + e.toString());
            }
        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion"); // d144064

    }
1218324
def on_receive(self, message=None, wire=None, event_origin=None):

        

        self.trigger("before_call", message)

        fn_name = message.data
        pmsg = self.prepare_message

        try:
            for handler in self.handlers:
                handler.incoming(message, self)

            fn = self.get_function(fn_name, message.path)
        except Exception as inst:
            wire.respond(message, ErrorMessage(str(inst)))
            return

        if callable(fn) and getattr(fn, "exposed", False):
            try:
                r = fn(*message.args, **message.kwargs)
                if isinstance(r,Message):
                    wire.respond(message, pmsg(r))
                else:
                    wire.respond(message, pmsg(Message(r)))
            except Exception as inst:
                if self.debug:
                    wire.respond(message, pmsg(ErrorMessage(str(traceback.format_exc()))))
                else:
                    wire.respond(message, pmsg(ErrorMessage(str(inst))))
        else:
            wire.respond(
                message,
                pmsg(
                    ErrorMessage("action '%s' not exposed on API (%s)" % (fn_name, self.__class__.__name__)))
                )

        self.trigger("after_call", message)