Called when the initialization is completed.

@see org.apache.uima.collection.processing.StatusCallbackListener#initializationComplete()
974257
public void initializationComplete() {
    if (UIMAFramework.getLogger().isLoggable(Level.CONFIG)) {
      UIMAFramework.getLogger(this.getClass()).logrb(Level.CONFIG, this.getClass().getName(),
              "process", CPMUtils.CPM_LOG_RESOURCE_BUNDLE, "UIMA_CPM_cpm_init_complete__CONFIG",
              new Object[] { Thread.currentThread().getName() });
    }
  }
986612
@Override
    public void complete(VirtualConnection vc) {

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "complete() called: vc=" + vc);
        }
        // The VC might be null if the channel was destroyed before the callback completes
        if (vc != null) {
            HttpInboundServiceContextImpl mySC = (HttpInboundServiceContextImpl) vc.getStateMap().get(CallbackIDs.CALLBACK_HTTPISC);
            mySC.finishSendError();
        }
    }
102923
@Override
    public void complete(Symbol sym) throws CompletionFailure {
        // Suppress some (recursive) MemberEnter invocations
        if (!completionEnabled) {
            // Re-install same completer for next time around and return.
            Assert.check((sym.flags() & Flags.COMPOUND) == 0);
            sym.completer = this;
            return;
        }

        try {
            annotate.blockAnnotations();
            sym.flags_field |= UNATTRIBUTED;

            List<Env<AttrContext>> queue;

            dependencies.push((ClassSymbol) sym, CompletionCause.MEMBER_ENTER);
            try {
                queue = completeClass.completeEnvs(List.of(typeEnvs.get((ClassSymbol) sym)));
            } finally {
                dependencies.pop();
            }

            if (!queue.isEmpty()) {
                Set<JCCompilationUnit> seen = new HashSet<>();

                for (Env<AttrContext> env : queue) {
                    if (env.toplevel.defs.contains(env.enclClass) && seen.add(env.toplevel)) {
                        finishImports(env.toplevel, () -> {});
                    }
                }
            }
        } finally {
            annotate.unblockAnnotations();
        }
    }
283504
@Override
    public void afterCompletion(int status) {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { 
            Tr.entry(this, tc, "afterCompletion", status);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { 
            Tr.debug(this, tc, "Using transaction wrapper@" + Integer.toHexString(this.hashCode()));
        }


        // When afterCompletionCode is called we need to reset the registeredForSync flag.
        registeredForSync = false;

        /*
         * Mark the transaction complete in the wrapper
         */

        // Do NOT catch runtime exceptions here.  Let them flow out
        // of the component.
        mcWrapper.transactionComplete();

        // Check if any connection handles are still in use
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { 
            if (mcWrapper.getHandleCount() != 0) {
                // Issue warning that Connections have not been closed by
                // the end of the current UOW scope and will be closed
                // by the CM.
                //            Tr.warning(this, tc,"HANDLE_NOT_CLOSED_J2CA0055");
                // removed null check on mcWrapper since it is redundant from the above code (mcWrapper.getUOWCoordinator())
                String pmiName = mcWrapper.gConfigProps.cfName;
                Tr.debug(this, tc, "Information:  handle not closed at end of UOW for resource " + pmiName);
            }
        }

        // Do NOT catch the runtime exception which getConnectionManager
        // might throw. If this is thrown it is an internal bug and needs
        // to be fixed. Allow the rte to flow up to the container.
        boolean shareable = mcWrapper.getConnectionManager().shareable();

        //
        // If the connection is shareable, or it is non-shareable and the
        // handleCount is zero, then release it back to the poolManger,
        // otherwise simply reset the transaction related variables.
        //
        // Note: shareable connections are released at the end of
        // transactions regardless of outstanding handles because we don't
        // support handled being associated to an active
        //  managedConnection outside of a sharing boundary.
        if ((shareable) || (!shareable && mcWrapper.getHandleCount() == 0)) {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { 
                Tr.debug(this, tc, "afterCompletionCode: Releasing the connection to the pool. Shareable = " + shareable);
            }

            try {
                mcWrapper.releaseToPoolManager();
            } catch (Exception e) {
                // Do not rethrow the exception here since the client has
                // successfully completed the transaction.
                // Log the error and go on.

                // need to change the "291" number below
                com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ejs.j2c.RRSLocalTransactionWrapper.afterCompletion", "291", this);
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { 
                    String pmiName = mcWrapper.gConfigProps.cfName;
                    Tr.debug(this, tc, "afterCompletionCode for resource " + pmiName + ":  caught Exception", e);
                }
            }

        } // end ((shareable) || (!shareable && mcWrapper.getHandleCount() == 0))
        else {
            /*
             * The cleanup of the coordinator and enlisted flag should
             * only be done here for non sharable connections. In other cases,
             * the coord is set to null in mcWrapper.releaseToPoolManager().
             * We only need to worry about this here if the handleCount is
             * greater than 0 (in which case the cleanup will be done
             * by the poolManager). Same thing for the tranFailed flag in
             * the MCWrapper.
             */
            enlisted = false;
            //     mcWrapper.setTranFailed(false);
            mcWrapper.setUOWCoordinator(null);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            Tr.exit(this, tc, "afterCompletion");

    }
1356227
function _initComplete(err, result) {
          if( !isResolved ) {
            isResolved = true;
            if( err ) { def.reject(err); }
            else { def.resolve(result); }
          }
        }
50819
@Override
    public void initialize() {
        Exceptions.checkNotClosed(this.closed.get(), this);
        long traceId = LoggerHelpers.traceEnter(log, "initialize");
        long containerCount = this.segmentToContainerMapper.getTotalContainerCount();
        ArrayList<CompletableFuture<Void>> futures = new ArrayList<>();
        for (int containerId = 0; containerId < containerCount; containerId++) {
            futures.add(this.registry.startContainer(containerId, INIT_TIMEOUT_PER_CONTAINER)
                                     .thenAccept(this::registerHandle));
        }

        Futures.allOf(futures).join();
        LoggerHelpers.traceLeave(log, "initialize", traceId);
    }
722918
public void keypointComplete()
    {
        if (tc.isEntryEnabled())
            Tr.entry(tc, "keypointComplete", this);

        _status = STATUS_ACTIVE;

        if (tc.isEntryEnabled())
            Tr.exit(tc, "keypointComplete");
    }
84703
@Override
    public final void onCompleted(String pin) {
        resetStatus();
        if ("".equals(firstPin)) {
            firstPin = pin;
            setLabel(getString(R.string.message_confirm_pin));
        } else {
            if (pin.equals(firstPin)) {
                onPinSet(pin);
                setResult(SUCCESS);
                finish();
            } else {
                setLabel(getString(R.string.message_pin_mismatch));
                firstPin = "";
            }
        }
        resetStatus();
    }
1294437
public void afterCompletion(int status)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.entry(tc, "afterCompletion (" + status + ") : " + this);

        try
        {
            // inform the activator that the session has ended
            // so the beans can be passivated if necessary
            BeanO[] beanOs = getBeanOs();
            EJBKey[] ejbKeys = getEJBKeys(beanOs);
            if (beanOs != null) {
                for (int i = 0; i < beanOs.length; ++i) {
                    BeanO beanO = beanOs[i];
                    try {
                        ivContainer.activator.unitOfWorkEnd(this, beanO);
                    } catch (Throwable ex) {
                        FFDCFilter.processException(ex, CLASS_NAME + ".afterCompletion",
                                                    "214", this);
                        if (isTraceOn && tc.isEventEnabled()) // d144064
                            Tr.event(tc,
                                     "Exception thrown in afterCompletion()",
                                     new Object[] { beanO, ex });
                    }
                }
            }
            // inform the unit of controller the session has ended
            // so references that are no longer needed can be released
            ivContainer.uowCtrl.sessionEnded(ejbKeys);

            //d425046 Ensure ContainerAS not available now
            ContainerTx tx = ivContainer.getCurrentTx(false);
            if (tx != null)
            {
                tx.setContainerAS(null); // prevent activation strategy finding
                if (isTraceOn && tc.isDebugEnabled())
                    Tr.debug(tc, "removed ContainerAS during afterCompletion");
            }

        } catch (Throwable t) {
            FFDCFilter.processException(t, CLASS_NAME + ".afterCompletion", "219", this);
            if (isTraceOn && tc.isEventEnabled()) // d144064
                Tr.event(tc, "Exception during afterCompletion", t);
            throw new RuntimeException(t.toString());
        } finally {
            ivContainer.containerASCompleted(ivASKey);
        }

        if (isTraceOn && tc.isEntryEnabled()) // d144064
            Tr.exit(tc, "afterCompletion");
    }
575668
void initialized() {
    LOG.info("initialized with " + size() + " entries " + lookups + " lookups");
    this.initialized = true;
    transientMap.clear();
    transientMap = null;
  }
859360
private void onNextAttemptStarted(CompletionStage<Boolean> futureOutcome) {
    assert executor.inEventLoop();
    state = State.ATTEMPT_IN_PROGRESS;
    futureOutcome
        .whenCompleteAsync(this::onNextAttemptCompleted, executor)
        .exceptionally(UncaughtExceptions::log);
  }
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

    }
1098344
public void init() {
        try {
            initPlugin();
        } catch (RuntimeException e) {
            LOG.error("init metrics plugin error:", e);
            System.exit(-1);
        }

        pushRefreshEvent();
        pushFlushEvent();
        pushMergeEvent();
        pushUploadEvent();
        pushDiagnosisEvent();
        LOG.info("Finish");
    }
903726
@SuppressWarnings({ "rawtypes", "unchecked" })
  void complete() {

    if (this.range != null) {
      AbstractValidatorRange validator = null;
      if (this.valueType != null) {
        Class<?> valueClass = this.valueType.getAssignmentClass();
        if (this.valueType.isCollection()) {
          validator = new ValidatorCollectionSize(this.range);
        } else if (this.valueType.isMap()) {
          validator = new ValidatorMapSize(this.range);
        } else if (this.valueType.getComponentType() != null) {
          validator = new ValidatorArrayLength(this.range);
        } else if (this.mathUtil.getNumberType(valueClass) != null) {
          validator = new ValidatorRange<>(this.range);
        }
      }
      if (validator == null) {
        validator = new ValidatorRangeGeneric<>(this.range);
      }
      this.validatorRegistry.add(validator);
    }
  }
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;
  }
1051598
@Restricted(NoExternalUse.class)
    public synchronized final void maybeComplete() {
        assert this.executor != null;
        if (result != null) {
            executor.completedAsynchronous(result != NULL ? result : null);
            result = null;
        }
    }
384580
private int setCompletion(int completion) {
        for (int s;;) {
            if ((s = status) < 0)
                return s;
            if (U.compareAndSwapInt(this, STATUS, s, s | completion)) {
                if ((s >>> 16) != 0)
                    synchronized (this) { notifyAll(); }
                return completion;
            }
        }
    }