docs: @Trivial
      protected void deactivateEndpointInternal(EndpointActivationService eas) throws ResourceException {
          boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
          if (isTraceOn && tc.isEntryEnabled())
              Tr.entry(tc, "MEF.deactivateEndpointInternal for MDB " + beanMetaData.enterpriseBeanName + "(" + eas + ")");
  
          Object deactivationKey;
          ResourceException rex = null;
  
          synchronized (ivStateLock) {
              if ((ivState == ACTIVE_STATE) || (ivState == DEACTIVATE_PENDING_STATE)) {
                  ivState = DEACTIVATING_STATE;
                  deactivationKey = activationSpec;
                  if (deactivationKey == null) {
                      // This occurs when the endpoint activation service forcefully
                      // deactivates the endpoint. When this occurs all we need to
                      // do is change state since the endpoint was already deactivated.
                      ivState = INACTIVE_STATE; //d450478
                  }
  
              } else if (ivState != INACTIVE_STATE) {
                  throw new ResourceException("illegal state for deactivate");
              }
          }
          if (eas != null && isEndpointActive()) {
              EJBThreadData threadData = EJSContainer.getThreadData();
              threadData.pushMetaDataContexts(beanMetaData);
              try {
                  eas.deactivateEndpoint(activationSpec, this);
              } catch (ResourceException ex) {
                  rex = ex;
              } catch (Throwable ex) {
                  rex = new ResourceException(ex);
              }
              threadData.popMetaDataContexts();
          }
  
          synchronized (ivStateLock) {
              // Reset even if the EAS is null or there was a failure, the endpoint is considered
              // deactivated (i.e. only try one time)
              activationSpec = null;
              unsetRecoveryID();
              ivState = INACTIVE_STATE;
          }
  
          Tr.info(tc, "MDB_ENDPOINT_DEACTIVATED_CNTR4014I", beanMetaData.enterpriseBeanName);
  
          if (isTraceOn && tc.isEntryEnabled())
              Tr.exit(tc, "MEF.deactivateEndpointInternal for MDB " + beanMetaData.enterpriseBeanName);
  
          if (rex != null) {
              throw rex;
          }
      }