Performs a given Action on the FX thread when onCompleted is called
@param onCompleted
@param <T>
431794
public static <T> ObservableTransformer<T,T> doOnCompleteFx(Action onCompleted) {
        return obs -> obs.doOnComplete(() -> runOnFx(onCompleted));
    }
1219337
public void onCompleted() {
    mSerializingExecutor.execute(() -> {
      Preconditions.checkState(mContext != null);
      try {
        completeRequest(mContext);
        replySuccess();
      } catch (Exception e) {
        LogUtils.warnWithException(LOG, "Exception occurred while completing write request {}.",
            mContext.getRequest(), e);
        Throwables.throwIfUnchecked(e);
        abort(new Error(AlluxioStatusException.fromCheckedException(e), true));
      }
    });
  }
1215429
@Override
    public void afterCompletion(int status)
    {

        boolean committed = true;
        boolean reLoad = false;
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2

        if (status != Status.STATUS_COMMITTED) {
            committed = false;
        }

        if (isTraceOn && TETxLifeCycleInfo.isTraceEnabled()) // PQ74774
        { // PQ74774
            String tid = getTxId();
            if (tid != null)
            {
                if (globalTransaction)
                {
                    TETxLifeCycleInfo.traceGlobalTxAfterCompletion(tid, "Global/User Tx AfterCompletion");
                } else
                {
                    TETxLifeCycleInfo.traceLocalTxAfterCompletion(tid, "Local Tx AfterCompletion");
                }
            }
        } // PQ74774

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

        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.entry(tc, "afterCompletion"
                     , new Object[] { Boolean.valueOf(globalTransaction), this,
                                     Boolean.valueOf(committed),
                                     Boolean.valueOf(isActivitySessionCompleting) }
                            ); //123293

        // When an EJB method ends, we need to remove bean-specific contexts from
        // the thread.  Those contexts need to be present for beforeCompletion for
        // JPA @PreUpdate, so postInvoke cannot pop the contexts prior to
        // transaction completion, but the calls to Activator.commit/.rollbackBean
        // below might unpin the currently invoked bean from the current
        // transaction, which would allow the bean to be active concurrently on
        // another thread while other transaction callbacks are running on this
        // thread.  To avoid that, pop the contexts now if this transaction is
        // being completed because an EJB method is ending.              RTC107108
        if (ivPostInvokeContext != null)
        {
            ivContainer.postInvokePopCallbackContexts(ivPostInvokeContext);
            ivPostInvokeContext = null;
        }

        try {

            if (committed) {

                // d126930.3
                // By default activitSessionCompleting is set to true.  Even if there
                // is no activitySession present.  This simply means we follow the noraml
                // ContainerTx logic for ending a transaction.

                if (isActivitySessionCompleting == true) {

                    becomeCommitted();

                    // Since we're committing, we can now allow timers queued to
                    // start to be started (not in this list if also cancelled).
                    if (timersQueuedToStart != null) {
                        for (TimerNpImpl timer : timersQueuedToStart.values()) {
                            timer.start();
                        }
                    }

                    // Any timers canceled in this global tran were added to
                    // timersCanceled in case they needed to be re-created in
                    // rollback.  Since we're not rolling back, go ahead and
                    // destroy these, then clear this map
                    if (timersCanceled != null) {
                        for (TimerNpImpl timer : timersCanceled.values()) {
                            timer.remove(true); // RTC107334
                        }
                    }

                    // d111555  Only perform if a beanO has been enlisted
                    if (ivBeanOsEnlistedInTx) {
                        //115597 changed to use afterList
                        int afterListSize = afterList.size(); // d122418-5
                        for (int i = 0; i < afterListSize; i++) // d122418-5
                        {
                            BeanO beanO = afterList.get(i); // d122418-5
                            try {
                                beanO.commit(this);
                            } catch (Throwable ex) {
                                FFDCFilter.processException(ex,
                                                            CLASS_NAME + ".afterCompletion",
                                                            "795", this);
                                if (isTraceOn && tc.isEventEnabled()) // d144064
                                    Tr.event(tc, "Exception thrown in commit()",
                                             new Object[] { beanO, ex });
                            } finally {
                                // Perform the Activation Strategy afterCompletion -
                                // commit processing. Ignore any exception that may
                                // occur, as the transaction has already committed
                                // and insure the rest of the beans in the list
                                // get processed to minimize side effects of any
                                // failure here.                                 d145697
                                try {
                                    ivContainer.activator.commitBean(this, beanO);
                                } catch (Throwable ex) {
                                    FFDCFilter.processException(ex,
                                                                CLASS_NAME +
                                                                                ".afterCompletion",
                                                                "811", this);
                                    if (isTraceOn && tc.isEventEnabled())
                                        Tr.event(tc, "Exception thrown in commitBean()",
                                                 new Object[] { beanO, ex });
                                }
                            }
                        } // end for
                    } // if ivBeanOsEnlistedInTx               // d111555

                    // d126930.3
                    // --------------------------------------------------------------
                    // Special case added for mid-activitySession checkpoint.  Entity
                    // beans enlisted in local transactions must be stored during
                    // the checkpoint.  This occured at beforeCompletion time.  Here
                    // we just do nothing, to make sure the bean's state does not
                    // not change.
                    // --------------------------------------------------------------

                } else { //checkpoint/reset processing

                    reLoad = true;

                } // end else (special case for mid-ActivitySession checkpoint)

            } else { // JTS Status is Rollback

                // d126930.3
                // By default activitSessionCompleting 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 == true) {

                    becomeRolledback();

                    // re-start any timers that had been cancelled in this global tran
                    if (timersCanceled != null) {
                        for (TimerNpImpl timer : timersCanceled.values()) {
                            timer.start();
                            if (isTraceOn && tc.isDebugEnabled()) {
                                Tr.debug(tc, "rollback re-started queued-as-canceled timer: " + timer);
                            }
                        }
                    }

                    // Do not start timers queued to start.  Rather, mark them
                    // destroyed and clear the queue.
                    if (timersQueuedToStart != null) {
                        for (TimerNpImpl timer : timersQueuedToStart.values()) {
                            timer.remove(true); // RTC107334
                            if (isTraceOn && tc.isDebugEnabled()) {
                                Tr.debug(tc, "rollback destroyed queued-to-start timer: " + timer);
                            }
                        }
                    }

                    // d111555 only preform if one or more beans in tx
                    if (ivBeanOsEnlistedInTx) { // d111555
                        int afterListSize = afterList.size(); // d122418-5
                        //d115597 changed to use afterList
                        for (int i = 0; i < afterListSize; i++) // d122418-5
                        {
                            BeanO beanO = afterList.get(i); // d122418-5
                            try {
                                beanO.rollback(this);
                            } catch (Throwable ex) {
                                FFDCFilter.processException(ex,
                                                            CLASS_NAME + ".afterCompletion",
                                                            "863", this);
                                if (isTraceOn && tc.isEventEnabled()) // d144064
                                    Tr.event(tc, "Exception thrown in rollback()",
                                             new Object[] { beanO, ex });
                            } finally {
                                // Perform the Activation Strategy afterCompletion -
                                // commit processing. Ignore any exception that may
                                // occur, as the transaction has already committed
                                // and insure the rest of the beans in the list
                                // get processed to minimize side effects of any
                                // failure here.                                 d145697
                                try {
                                    ivContainer.activator.rollbackBean(this, beanO);
                                } catch (Throwable ex) {
                                    FFDCFilter.processException(ex,
                                                                CLASS_NAME +
                                                                                ".afterCompletion",
                                                                "879", this);
                                    if (isTraceOn && tc.isEventEnabled())
                                        Tr.event(tc, "Exception thrown in rollbackBean()",
                                                 new Object[] { beanO, ex });
                                }
                            }
                        } // while
                    } // if ivBeanOsEnlistedInTx              // d111555

                    // d126930.3
                    // -------------------------------------------------------------
                    // Special case added for mid-activitySession reset.  Entity
                    // beans enlisted in local transactions must be reloaded
                    // from the backing store to erase any in-memory updates that
                    // were done up to this point (ie. reset them).  For other bean
                    // types, we do nothing on mid-activitySession reset. The local
                    // transaction service will make a setCompleting = false call on
                    // the containerSynchronization interface, followed by an
                    // afterCompletion call.  These calls are not preceeded a
                    // a beforeCompletion call.  The beans' state should not be
                    // changed.  We just reload them.
                    // -------------------------------------------------------------

                } else {
                    reLoad = true;
                }

            } // end else (rollback)

        } catch (Throwable t) {

            FFDCFilter.processException(t, CLASS_NAME + ".afterCompletion",
                                        "913", this);
            if (isTraceOn && tc.isEventEnabled()) // d144064
                Tr.event(tc, "Exception during afterCompletion", t);
            throw new RuntimeException(t.toString());

        } finally { //110762.1

            // Persistence Manager wants notified

            try {
                if (txListener != null)
                    try {
                        txListener.afterCompletion(status); // d160445
                        txListener = null;
                    } catch (Throwable e) {
                        FFDCFilter.processException(e, CLASS_NAME + ".afterCompletion",
                                                    "929", this);
                        throw new Exception("txListener exception" + e.toString());
                    }
            } catch (Throwable e) {
                FFDCFilter.processException(e, CLASS_NAME + ".afterCompletion",
                                            "934", this);
            }

            if (!reLoad)
                ivContainer.containerTxCompleted(this); //d153430 added reLoad flag
        } // end finally

        // Activity session checkpoint.

        if (reLoad && afterList != null && !afterList.isEmpty()) { // d630940
            // Reset flag so beans will return to normal ContainerTx logic
            // unless another activitySession checkpoint or reset call is made.

            // Save the BeanOs processed in the following loop in an instance variable
            // so methods called from the customer callbacks can determine which beanO
            // is active on the thread. Access the BeanO in the loop in a local
            // variable for performance.                                       d168509
            EJBThreadData threadData = EJSContainer.getThreadData(); // d630940
            boolean popCallbackBeanO = false;
            ComponentMetaData prevCMD = null;
            boolean resetCMD = false;
            ClassLoader prevClassLoader = null;
            Object origClassLoader = ThreadContextAccessor.UNCHANGED;

            try
            {
                int afterListSize = afterList.size();
                for (int i = 0; i < afterListSize; i++)
                {
                    BeanO beanO = afterList.get(i);
                    try
                    {
                        BeanMetaData bmd = beanO.home.beanMetaData;

                        if (bmd.type == InternalConstants.TYPE_CONTAINER_MANAGED_ENTITY ||
                            bmd.type == InternalConstants.TYPE_BEAN_MANAGED_ENTITY)
                        {
                            attachListener();
                            if (txListener != null) {
                                txListener.afterBegin();
                            } else {
                                throw new Exception("Error: Null Transaction Listener");
                            }

                            // If the Entity bean has exclusive access to the data
                            // (OptA) or the LoadPolicy has defined a reload interval
                            // (ReadOnly), then there is no need to re-load the
                            // bean.  Otherwise, the Entity bean must be reloaded
                            // to acquire the proper DB locks. The forUpdate = false
                            // parameter has no effect because these are EJB 2.0
                            // beans.  Both BMP and CMP entities must use the
                            // access intent information from the application
                            // profile to determine the locking requirements.
                            // Also, we make sure the correct ComponentMetaData
                            // and local transaction context is on the thread before
                            // loading the bean.
                            if (bmd.optionACommitOption ||
                                bmd.ivCacheReloadType != BeanMetaData.CACHE_RELOAD_NONE)
                            {
                                // Bean is not re-loaded, but PM needs to be informed
                                // the bean is enlisted with the tran.               LI3408
                                ((EntityBeanO) beanO).enlistForOptionA(this);
                            }
                            else
                            {
                                threadData.pushCallbackBeanO(beanO); // d168509, d630940
                                popCallbackBeanO = true;

                                // Update the thread CMD if it's not the same as the
                                // previous bean and this is a bean-managed bean.
                                if (bmd != prevCMD &&
                                    bmd.type == InternalConstants.TYPE_BEAN_MANAGED_ENTITY)
                                {
                                    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);
                                    }
                                }

                                Object cmdCtxSet = null;
                                TxContextChange changedContext = null;
                                try {
                                    cmdCtxSet = cmdAccessor.beginContext(bmd);
                                    changedContext = uowCtrl.setupLocalTxContext(beanO.getId());
                                    ((EntityBeanO) beanO).load(this, false);
                                } finally {
                                    uowCtrl.teardownLocalTxContext(changedContext);
                                    if (cmdCtxSet != null) {
                                        cmdAccessor.endContext();
                                    }
                                }

                                popCallbackBeanO = false;
                                threadData.popCallbackBeanO();
                            }
                        }

                    } catch (Throwable ex) {
                        FFDCFilter.processException(ex,
                                                    CLASS_NAME + ".afterCompletion",
                                                    "978", this);
                        if (isTraceOn && tc.isEventEnabled()) // d144064
                            Tr.event(tc, "Exception thrown attempting to reload bean " +
                                         "due to activitySession reset",
                                     new Object[] { beanO, ex });

                        //d135218 - added destroy, setRollbackOnly, logException, &
                        //          throw exception below to match beforeCompletion
                        //          logic since ActiviySession reset occurs during
                        //          the middle of a local transaction, not at the
                        //          end, like afterCompletion usually handles.

                        // Destroy the beanO, too late to delist. Destroying it should
                        // take care of the state when the transaction is rolled back
                        beanO.destroy();

                        ivContainer.uowCtrl.setRollbackOnly();

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

                        // Inform the activitySession service that reset
                        // failed.
                        throw new RuntimeException(ex.toString());

                    }
                } // end for loop
            } finally
            {
                EJBThreadData.svThreadContextAccessor.popContextClassLoaderForUnprivileged(origClassLoader);

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

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

        } // end else (special case for mid-ActivitySession reset)

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

    }
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

    }
1363541
synchronized void onComplete(@javax.annotation.Nullable Throwable error) {
    if (isCompleted()) {
      return;
    }
    currentConfigObserver = null;
    // TODO(songya): add Runnable
    Status status;
    if (error == null) {
      status = Status.OK;
    } else if (error instanceof StatusRuntimeException) {
      status = ((StatusRuntimeException) error).getStatus();
    } else {
      status = Status.UNKNOWN;
    }
    terminateStatus = status;
  }
586134
public void requestCompleted (T result)
    {
        _result = result;
        ResultListener<T> list = _list;
        _list = null;

        list.requestCompleted(result);
    }
358622
public void afterCompleted(Event event) {
		ChaincodeMessage message = messageHelper(event);
		logger.debug(String.format("[%s]sending COMPLETED to validator for tid", shortID(message)));
		try {
			serialSend(message);
		} catch (Exception e) {
			event.cancel(new Exception("send COMPLETED failed %s", e));
		}
	}
592785
@Override
	public void afterCompletion(int status) {

		CompletionDelegate delegate = this.delegates.get(status);
		if (delegate != null) {
			delegate.execute(this.solrOperations);
		}
	}
258833
public void setCompletedRequestCallback(ICompletedRequestCallback callback) {
		RequestWriter requestWriter = (RequestWriter) m_connection.getTraceWriter();
		requestWriter.getRequestSeparator().setCompletedRequestCallback(callback);
	}
297482
@Override
    public void afterCompletion(TransactionCommon tran, boolean committed)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "afterCompletion", new Object[] { tran, Boolean.valueOf(committed) });

        // We don't care if the transaction committed or rolled back, either way
        // this callback indicates that a message that this consumer had active
        // is no longer active and therefore we should decrement the active message
        // count (this callback is called once per active message).
        removeActiveMessages(1);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "afterCompletion");
    }
426743
@Override
    public void onComplete(OperationFuture<?> future) throws Exception {
        if (log.isDebugEnabled()) log.debug("BEGIN : onComplete - Calling Countdown. Completed Future = " + future + "; App : " + appName); 
        countDown();
        completeCount++;
        if(getCompletedCount() >= getExpectedSuccessCount()) {
            final String cachePrefix = null;
            EVCacheMetricsFactory.getStatsTimer(getAppName(), cachePrefix, "LatchPolicyDuration").record(System.currentTimeMillis() - startTimeMS);
            if (log.isDebugEnabled()) log.debug("Future policy satisfied. Last Completed Future = " + future + ". Took " + (System.currentTimeMillis() - startTimeMS) + " milliseconds"); 
        }
        EVCacheMetricsFactory.increment(appName, null, "EVCacheLatchImpl-OnComplete");
        if(evcacheEvent != null) {
            if (log.isDebugEnabled()) log.debug(";App : " + evcacheEvent.getAppName() + "; Call : " + evcacheEvent.getCall() + "; Keys : " + evcacheEvent.getEVCacheKeys() + "; completeCount : " + completeCount + "; totalFutureCount : " + totalFutureCount +"; failureCount : " + failureCount);
            try {
                if(future.isDone() && future.get().equals(Boolean.FALSE)) {
                    failureCount++;
                }
            } catch (Exception e) {
                failureCount++;
                if(log.isDebugEnabled()) log.debug(e.getMessage(), e);
            }
            if(!onCompleteDone && getCompletedCount() >= getExpectedSuccessCount()) {
                if(evcacheEvent.getClients().size() > 0) {
                    for(EVCacheClient client : evcacheEvent.getClients()) {
                        final List<EVCacheEventListener> evcacheEventListenerList = client.getPool().getEVCacheClientPoolManager().getEVCacheEventListeners();
                        for (EVCacheEventListener evcacheEventListener : evcacheEventListenerList) {
                            evcacheEventListener.onComplete(evcacheEvent);
                        }
                        EVCacheMetricsFactory.increment(evcacheEvent.getAppName(), evcacheEvent.getCacheName(), "EVCacheLatchImpl-OnComplete-Done");
                        onCompleteDone = true;//This ensures we fire onComplete only once
                        break;
                    }
                }
            }
            if(scheduledFuture != null) {
                final boolean futureCancelled = scheduledFuture.isCancelled(); 
                if (log.isDebugEnabled()) log.debug("App : " + evcacheEvent.getAppName() + "; Call : " + evcacheEvent.getCall() + "; Keys : " + evcacheEvent.getEVCacheKeys() + "; completeCount : " + completeCount + "; totalFutureCount : " + totalFutureCount +"; failureCount : " + failureCount + "; futureCancelled : " + futureCancelled);
                if(onCompleteDone && !futureCancelled) {
                    if(completeCount == totalFutureCount && failureCount == 0) { // all futures are completed
                        final boolean status = scheduledFuture.cancel(true);
                        if (log.isDebugEnabled()) log.debug("Cancelled the scheduled task : " + status);
                        if(status) {
                            EVCacheMetricsFactory.increment(evcacheEvent.getAppName(), evcacheEvent.getCacheName(), "EVCacheLatchImpl-OnComplete-FutureUnregistered-SUCCESS");
                        } else {
                            EVCacheMetricsFactory.increment(evcacheEvent.getAppName(), evcacheEvent.getCacheName(), "EVCacheLatchImpl-OnComplete-FutureUnregistered-FAIL");
                        }
                    }
                }
            }
            if (log.isDebugEnabled()) log.debug("App : " + evcacheEvent.getAppName() + "; Call : " + evcacheEvent.getCall() + "; Keys : " + evcacheEvent.getEVCacheKeys() + "; completeCount : " + completeCount + "; totalFutureCount : " + totalFutureCount +"; failureCount : " + failureCount);
        }
        if (log.isDebugEnabled()) log.debug("END : onComplete - Calling Countdown. Completed Future = " + future + "; App : " + appName); 
    }
845698
@Override
    public final synchronized void beforeCompletion()
                    throws RemoteException
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled())
            Tr.entry(tc, "beforeCompletion: " + getStateName(state), currentTx); //123293

        if (removed) {
            if (isTraceOn && tc.isEntryEnabled())
                Tr.exit(tc, "beforeCompletion: removed");
            return;
        }

        switch (state)
        {
            case TX_METHOD_READY:
                setState(COMMITTING_OUTSIDE_METHOD);
                break;

            case TX_IN_METHOD:
                setState(COMMITTING_IN_METHOD);
                break;

            // Could happen during async rollback
            case IN_METHOD:
            case METHOD_READY:
            case DESTROYED:
                if (isTraceOn && tc.isEntryEnabled())
                    Tr.exit(tc, "beforeCompletion: asynch rollback: " + getStateName(state));
                return;

            default:
                if (isTraceOn && tc.isDebugEnabled()) // d144064
                    Tr.debug(tc, "invalid state: " + state); //123293
                throw new InvalidBeanOStateException(StateStrs[state],
                                "TX_IN_METHOD | " +
                                                "TX_METHOD_READY");

        }

        if (isTraceOn && tc.isEntryEnabled())
            Tr.exit(tc, "beforeCompletion: " + getStateName(state));

    }
658306
@Override
    public void afterCompletion(TransactionCommon transaction, boolean committed)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "afterCompletion", new Object[] { transaction, Boolean.valueOf(committed) });

        synchronized (this)
        {
            // If the connection is already closed this transaction
            // will have been removed.
            if (!_closed)
            {
                synchronized (_ownedTransactions)
                {
                    // Remove the transaction from the connections list
                    _ownedTransactions.remove(transaction);
                }
            }
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "afterCompletion");
    }
476192
@Override
    public final void onCompleted(String pin) {
        resetStatus();
        if (isPinCorrect(pin)) {
            setResult(SUCCESS);
            finish();
        } else {
            setLabel(getString(R.string.message_invalid_pin));
        }
    }
1291098
public void requestCompleted (final T result)
    {
        apply(new ObserverOp<ResultListener<T>>() {
            public boolean apply (ResultListener<T> observer) {
                observer.requestCompleted(result);
                return true;
            }
        });
    }
66589
@Override
  public void completing(DelegateExecution execution, DelegateExecution subProcessInstance) throws Exception {
    if (activityBehaviorInstance == null) {
      activityBehaviorInstance = getActivityBehaviorInstance();
    }

    if (activityBehaviorInstance instanceof SubProcessActivityBehavior) {
      ((SubProcessActivityBehavior) activityBehaviorInstance).completing(execution, subProcessInstance);
    } else {
      throw new ActivitiException("completing() can only be called on a " + SubProcessActivityBehavior.class.getName() + " instance");
    }
  }
712356
void setComplete() {
    this.complete = true;
    try {
      // If we haven't gotten any results back, make sure to create an
      // empty one
      if (this.states.size() == 0) {
        this.states.put(new WorldState());
      }
      // Special WorldState to indicate that the request has completed and
      // interrupt
      // any blocking threads
      else {
        this.states.put(RESPONSE_COMPLETE);
      }
    } catch (InterruptedException e) {
      log.error("Interrupted trying to indicate a completed condition.", e);
    }
  }