docs: boolean eligibleForLock(EJSDeployedSupport methodContext, ContainerTx tx) // d671368
      {
          final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
  
          // If the bean is active on a thread and the threads match, then allow
          // the bean to be locked. This is a reentrant call, and transaction
          // enlistment will fail, as required.
          if (ivActiveOnThread != null) {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "eligibleForLock : ActiveOnThread : " + (ivActiveOnThread == Thread.currentThread()));
              return ivActiveOnThread == Thread.currentThread();
          }
  
          // If the bean is not active on a thread, then it has been unlocked
          // and is eligible for use on any thread. (Note that unlock will not
          // actually unlock if the bean is in a method and is switching between
          // local and global transactions for bean managed.) d648385 F743-22462.CR
          //
          // And, the bean is not in a transaction or the transactions match, then
          // the bean lock may be granted.
          //
          // Note that the transactions won't match if the bean is enlisted in a
          // sticky transaction, but the method on the current thread was started
          // and created a local tran prior to the sticky global being started.
          // For this scenario, don't grant the lock... this thread will wait
          // until the sticky transaction commits.
          if (currentTx == null || currentTx == tx) {
              if (isTraceOn && tc.isDebugEnabled())
                  Tr.debug(tc, "eligibleForLock : CurrentTx : true");
              return true;
          }
  
          // Finally, if the bean is not active on a thread, but it is enlisted in
          // a transaction that doesn't match, then it seems that it is not eligible.
          // And, if the bean's transaction was suspended on the current thread, and
          // access timeout is -1, then a deadlock will occur, which would normally
          // be an application problem. However, the spec requires that a call to
          // the 2.1 component remove result in an exception if the bean is enlisted
          // in a transaction. So check the current method context to see if the
          // bean's transaction was suspended and if so, report eligible. A reentrant
          // failure will be reported during enlistment.                     d704504
          UOWCookie uowCookie = methodContext.uowCookie;
          if (uowCookie != null) {
              if (currentTx.ivTxKey.equals(uowCookie.getSuspendedTransactionalUOW())) {
                  if (isTraceOn && tc.isDebugEnabled())
                      Tr.debug(tc, "eligibleForLock : SuspendedTx : true");
                  return true;
              }
          }
  
          if (isTraceOn && tc.isDebugEnabled())
              Tr.debug(tc, "eligibleForLock : false");
          return false;
      }