docs: private Object preInvokeActivate(EJSWrapperBase wrapper,
                                       int methodId,
                                       EJSDeployedSupport s,
                                       EJBMethodInfoImpl methodInfo) throws Exception {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled(); // d532639.2
          EJBThreadData threadData = s.ivThreadData; // d630940
          ContainerTx containerTx = null; // LI3795-56
          s.isLightweight = methodInfo.isLightweight; // LI3795-56
  
          s.methodInfo = methodInfo; // d140003.19 d114406
          s.ivCallerContext = threadData.pushMethodContext(s); // d515803, d646139.1, RTC102449
  
          // LIDB2775-23.1
          DispatchEventListenerCookie[] dispatchEventListenerCookies = null; // @MD16633A
  
          // LIDB2775-23.1 ASV60
          if (isZOS) {
              // To make it very obvious what the problem is, if an attempt is made
              // to invoke an EJB method in the CRA, throw an exception.    d450334.1
              if (isZOSCRA) {
                  throw new EJBException("EJB access not permitted in Adjunct process");
              }
  
              if (ivDispatchEventListenerManager != null &&
                  ivDispatchEventListenerManager.dispatchEventListenersAreActive()) {
                  // create and stack DispatchContext cookies ...
                  dispatchEventListenerCookies = ivDispatchEventListenerManager.getNewDispatchEventListenerCookieArray();
                  s.ivDispatchEventListenerCookies = dispatchEventListenerCookies; // d646413.2
              } //@MD16633A
          }
  
          // Pin and update the LRU data for any managed wrapper     d174057.2
          s.unpinOnPostInvoke = (wrapper.isManagedWrapper) ? wrapperManager.preInvoke(wrapper) : false;
  
          int isolationLevel = methodInfo.isolationAttr; // d114677 //d140003.20
  
          //86523.3
          // Pmi instrumentation for methods in beans
          // Use pmiBean cached in the wrapper.                     d140003.33
          EJBPMICollaborator pmiBean = wrapper.ivPmiBean; // d174057.2
          if (pmiBean != null) {
              s.pmiCookie = pmiBean.methodPreInvoke(wrapper.beanId, methodInfo);
              s.pmiPreInvoked = true;
          }
  
          BeanMetaData bmd = wrapper.bmd;
  
          // Push the ComponentMetaData onto the thread... for use by other
          // components invoked during the current EJB method call.
          // Note that this was done as the first BeforeActivationCollaborator
          // but for performance, the collaborator is no longer used, and
          // the CMD Accessor is used directly.                            LI3795-56
          threadData.ivComponentMetaDataContext.beginContext(bmd); // d646139.1
  
          // LI3795-56 - begin
          // -----------------------------------------------------------------------
          // For 'Lightweight' methods, as much of preInvoke and postInvoke is
          // skipped as possible, such as the SecurityCollaborator and setting
          // the class loader.  However, the following will be performed for
          // 'Lightweight' methods:
          //  - MethodContext (deployedsupport) will be pushed onto the current
          //    thread (see methodContext.beginContext above).
          //  - ComponentMetaData (bmd) will be pushed onto the current thread
          //    (see ivCMDAccessor.beginContext above).
          //  - Transaction collaborator may be called if a ContainerTx does
          //    not exist on the thread, or the Tx Attribute does not support
          //    a global transaction.
          //  - PMI and SMF(zOS) metrics will be collected if configured.
          // -----------------------------------------------------------------------
  
          // LI3795-56 - end
          // -----------------------------------------------------------------------
          // When not running in 'Lightweight' mode, perform full preInvoke and
          // postInvoke processing....
          // -----------------------------------------------------------------------
          if (!s.isLightweight) {
              // 112678.6
              // For a remote method, the preInvokeORBDispatch method interface is
              // called prior to this method, which already set thread context
              // loader, so only do this processing for a "local" method.   d115602-1
              if (methodInfo.setClassLoader) {
                  s.oldClassLoader = EJBThreadData.svThreadContextAccessor.pushContextClassLoaderForUnprivileged(bmd.ivContextClassLoader); // d369927, PK83186, F85059
              }
              //end 89188
  
              if (ivBeforeActivationCollaborators != null) { //87918.8(2)
                  for (int i = 0; i < ivBeforeActivationCollaborators.length; i++) {
                      if (isTraceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "preInvokeActivate : Invoking EJBComponentInitializationCollaborator.preInvoke method on: "
                                       + ivBeforeActivationCollaborators[i].getClass().getName());
                      //d140003.19
                      Object cookie = ivBeforeActivationCollaborators[i].preInvoke(s);
                      if (cookie != null) {
                          if (s.ivBeforeActivationCookies == null) {
                              s.ivBeforeActivationCookies = new Object[ivBeforeActivationCollaborators.length];
                          }
                          s.ivBeforeActivationCookies[i] = cookie;
                      }
                      s.ivBeforeActivationPreInvoked++; // d228192
                      //d140003.19
                  }
              }
  
              //92702
              if (ivBeforeActivationAfterCompletionCollaborators != null) {
                  int n = ivBeforeActivationAfterCompletionCollaborators.length;
                  for (int i = 0; i < n; i++) {
                      if (isTraceOn && tc.isDebugEnabled())
                          Tr.debug(tc, "preInvokeActivate : Invoking BeforeActivationAfterCompletionCollaborator.preInvoke method on: "
                                       + ivBeforeActivationAfterCompletionCollaborators[i].getClass().getName());
  
                      //d140003.19
                      Object cookie = ivBeforeActivationAfterCompletionCollaborators[i].preInvoke(s);
                      if (cookie != null) {
                          if (s.ivBeforeActivationAfterCompletionCookies == null) {
                              s.ivBeforeActivationAfterCompletionCookies = new Object[ivBeforeActivationAfterCompletionCollaborators.length];
                          }
                          s.ivBeforeActivationAfterCompletionCookies[i] = cookie;
                      }
                      s.ivBeforeActivationAfterCompletionPreInvoked++; // d228192
                      //d140003.19
                  }
              }
              //end 92702
          } // LI3795-56
  
          if (methodInfo.isLightweightTxCapable) {
              if (s.isLightweight) {
                  // A true lightweight bean.  Only reuse the caller's transaction if
                  // it was established by another EJB and runUnderUOW has not been
                  // called (i.e. user initiated tx).                        LI4548-11
                  EJSDeployedSupport sCaller = s.ivCallerContext;
                  if (sCaller != null &&
                      sCaller.ivRunUnderUOW == 0) {
                      ContainerTx currentTx = sCaller.currentTx;
                      if (currentTx != null && currentTx.isActiveGlobal()) {
                          containerTx = currentTx;
                          s.currentTx = containerTx;
                          containerTx.preInvoke(s);
                      }
                  }
              } else {
                  // An automatic lightweight transaction method.  Reuse the
                  // transaction context if possible.                         F61004.1
                  SynchronizationRegistryUOWScope uow = uowCtrl.getCurrentTransactionalUOW(false);
                  if (uow != null) {
                      // For SFSB, the optimization simulates enlist and commit of the
                      // active transaction for proper state transitions.  If a global
                      // transaction is active, CMT SFSB might already be enlisted, so
                      // we skip the optimization to avoid wrong state transitions.
                      boolean isLocal = uow.getUOWType() != UOWSynchronizationRegistry.UOW_TYPE_GLOBAL_TRANSACTION;
                      if (isLocal ||
                          bmd.type != InternalConstants.TYPE_STATEFUL_SESSION) {
                          // Ensure the caller transaction has not timed out.  This is
                          // an observable side effect of calling an EJB method, and it
                          // seems probable that a customer would make a call to a
                          // trivial EJB method just to check transaction timeout.
                          uowCtrl.completeTxTimeout();
  
                          containerTx = getCurrentTx(uow, isLocal);
                          s.currentTx = containerTx;
                          containerTx.preInvoke(s);
                      }
                  }
              }
  
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "Lightweight: Tx = " + containerTx);
          }
  
          // If the ContainerTx from a calling EJB is not being used (i.e.
          // 'Lightweight' mode), then invoke the transaction collaborator
          // and locate or create the ContainerTx as necessary, per the
          // method transaction attribute.                                 LI3795-56
          if (containerTx == null) {
              // NOTE: The following code to setup the transaction is 'duplicated'
              //       in transitionToStickyGlobalTransaction(...) as this may need
              //       to be redone when there is concurrent access for a BMT
              //       stateful bean with a sticky global transaction.        d671368
  
              //d140003.19
              s.uowCookie = uowCtrl.preInvoke(wrapper.beanId, methodInfo);
              s.uowCtrlPreInvoked = true;
              //d140003.19
  
              // Get the Container Transaction object (ContainerTx) associated
              // with the current transaction, as returned in the UOW Cookie
              // on UOW preInvoke.  This may return null for BMT (either for
              // EJB 1.1 modules or if the tran has rolled back) or it may
              // result in a CSITransactionRolledBack if the tran has been
              // rolled back or the Container was unable to enlist.         d139352-2
              boolean isLocal = s.uowCookie.isLocalTx();
              SynchronizationRegistryUOWScope UOWid = s.uowCookie.getTransactionalUOW();
              containerTx = getCurrentTx(UOWid, isLocal); // d161864
  
              if (containerTx != null) {
                  s.currentTx = containerTx;//d140003.19
                  containerTx.preInvoke(s);
  
                  //d140003.20
                  if (bmd.ivModuleVersion <= BeanMetaData.J2EE_EJB_VERSION_1_1 ||
                      (bmd.ivModuleVersion >= BeanMetaData.J2EE_EJB_VERSION_2_0 &&
                       bmd.cmpVersion == InternalConstants.CMP_VERSION_1_X)) {
                      containerTx.setIsolationLevel(isolationLevel);
                  }
                  //d140003.20
  
                  s.currentIsolationLevel = isolationLevel;
              }
          } // LI3795-56
  
          // LIDB2775-23.1 ASV60
          if (isZOS && dispatchEventListenerCookies != null) {
              // notify event dispatch listeners
              this.ivDispatchEventListenerManager.callDispatchEventListeners(DispatchEventListener.BEGIN_DISPATCH, dispatchEventListenerCookies, methodInfo); // @MD16426A
          }
  
          //******************************************************************
          // Note, we are required by EJB spec to discard bean instance if an
          // unchecked exception occurs from bean provider written code.  We are
          // not required to discard if unchecked exception comes from WAS code
          // rather than bean provider code.  Since all of the code prior to
          // activation of bean is WAS code and not bean provider code (we know
          // this since we do not have a bean instance until bean is activated),
          // then all unchecked exceptions prior to this point should NOT discard
          // the bean.   During activation, it is possible that bean provider written
          // code is called as a result of EJB callback methods that are invoked during
          // the activation (e.g setEntityBeanContext, setSessionBeanContext, ejbactivate,
          // ejbload, etc).   The code executed in activation path is responsible for
          // determining whether unchecked came from bean provider written code or from
          // WAS code.  If the former, then ensure discard occurs.  If the latter, we
          // prefer not to discard (although the latter behavior is not required
          // by EJB spec) to ensure existing testcases continue to work as currently
          // implemented by various test teams.  This may or may not be implemented
          // correctly at this moment in time.  However, if that is the case, then the
          // other WAS code needs to be fixed, not the code in this method of this class.
          // One final note is prior to activateBean call, s.beanO must be set to null and
          // s.preinvokeException set to false.  This ensures postInvoke method of this
          // class does nothing since any unchecked exceptions that occur prior to activate
          // and/or during activation is handled as previously described.
          //***************************************************************************
          BeanO beanO = activator.preInvokeActivateBean(threadData, containerTx, wrapper.beanId); // d114677, d630940, d641259
  
          // Activator will have pushed CallbackBeanO, except for home beans, which
          // are identified by a null home.                                  d694142
          s.ivPopCallbackBeanORequired = beanO.home != null;
  
          //************************************************************************
          // Now that we have a bean instance, we want to save its reference in
          // deployed support so that the postInvoke method of this class can correctly
          // process any unchecked exception that occurs from this point on.
          // Tthe postInvoke method of this class must check both s.beanO and s.preinvoke
          // to determine what action to take. If unchecked exception occurred while still
          // in preinvoke, s.preinvoke will be set to true.  In this case, the bean instance
          // should not be discarded since we know the unchecked exception did not come from
          // bean provider code (e.g not from the business method).  If s.preinvoke is false
          // and s.beanO != null, then we know the unchecked exception came from the
          // business method itself.  In that case, we must discard the bean instance
          // as required by the EJB spec  .
          //************************************************************************
  
          // Note, keep these 2 lines together and do not insert
          // anything between them.  Otherwise, if you put something
          // between them that causes an exception, then postinvoke will
          // more than likely fail with InvalidBeanOStateException.
          s.beanO = beanO; //d140003.19
          Object bean = beanO.preInvoke(s, containerTx);
  
          // return EJB that was activated/loaded.
          return bean;
      }