docs: @Override
      public void release()
      {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          {
              Tr.entry(tc, "MessageEndpoint.release");
          }
  
          //method param for checkState can be null since it's only used when the method is a MDB_BUSINESS_METHOD
          checkState(-1, null, RELEASE_METHOD);
  
          // d174179
          //d192893 - start of change
          if (ivEJSDeployedSupport != null)
          {
              // A call to afterCompletion did NOT occur prior to this release method call.
              // However, due to pre-condition of this method, we know the release method was
              // called by the same thread that called beforeDelivery.  For this case,
              // the JCA 1.5 spec requires release method to abort the transaction and
              // to throw IllegalStateException (since beforeDelivery and afterDelivery
              // must occur in pairs).
              try
              {
                  ContainerTx currentTx = ivEJSDeployedSupport.getCurrentTx();
                  if (currentTx != null) // d629697
                  {
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      {
                          Tr.debug(tc, "release is aborting transaction started by beforeDelivery since afterDelivery did not occur prior to release.");
                      }
  
                      // Force afterDelivery to rollback the transaction.
                      currentTx.setRollbackOnly();
                  }
  
                  // Using try/finally to preserve old reflection proxy behavior where
                  // afterDelivery() used to not directly call checkState(), but since
                  // the proxy invoke() method no longer exists it was moved down into
                  // afterDelivery().
                  try
                  {
                      ivSkipCheckState = true;
                      afterDelivery();
                  } finally
                  {
                      ivSkipCheckState = false;
                  }
  
                  // Note that the afterDelivery call will have changed the
                  // state out of the RELEASED state, but it will be changed
                  // back to RELEASED below                                d354603
              } catch (ResourceException re)
              {
                  // FFDCFilter.processException(t, CLASS_NAME + ".release", "1349", this);
  
                  // Ignore ResourceException from afterDelivery since we expect it to occur
                  // as a result of setting the rollback only flag.  However, set the discard
                  // required flag since we are not sure whether MessageEndpoint proxy is in a
                  // reusable state due to the transaction being aborted by RA.
                  ivDiscardRequired = true;
              } catch (Throwable t)
              {
                  FFDCFilter.processException(t, CLASS_NAME + ".release", "1359", this);
  
                  // We have an unexpected Throwable occurring during the abort.  Log this
                  // unexpected Throwable object and set the discard required flag since
                  // we are not sure whether MessageEndpoint proxy is in a reusable
                  // state due to the unexpected Throwable occurring.
                  ivDiscardRequired = true;
                  Tr.error(tc, "IGNORING_UNEXPECTED_EXCEPTION_CNTR0033E", t);
              }
          }
  
          // A call to afterCompletion did occur prior to this release method call.
          // In this case, check ivDiscardRequired flag to determine whether to
          // the discard instance or to return the instance to MessageEndpointFactory.
          if (ivDiscardRequired)
          {
              // Change state to remember this instance was discarded so that the checkState
              // method in this class will throw IllegalStateException if the RA
              // tries to use this instance after the release has occurred.
              synchronized (this)
              {
                  ivState = DISCARDED_STATE;
              }
  
              ivMessageEndpointFactory.returnInvocationHandler(this, false); // LI2110.56
  
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              {
                  Tr.debug(tc, "MessageEndpoint proxy was discarded as result of prior IllegalStateException occuring.");
              }
          }
          else
          {
              // Discard is not required.  In this case, return the invocation handler to
              // the MessageEndpointFactory so that it can pool the MessageEndpoint proxy instance.
              if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
              {
                  Tr.debug(tc, "returning MessageEndpoint proxy to the free pool");
              }
  
              // Insure the MessageEndpoint is in the 'RELEASED' state prior
              // to returning to the free pool. A call to checkState will have
              // done that prior to invoking this method, but the above call
              // to afterDelivery may have changed that.                   d354603
              synchronized (this)
              {
                  ivState = RELEASED_STATE;
              }
  
              ivMessageEndpointFactory.returnInvocationHandler(this, true); // LI2110.56
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          {
              Tr.exit(tc, "MessageEndpoint.release");
          }
  
          //d192893 - end of change.
      }