docs: @Override
      public void setManagedConnection(ManagedConnection newMC) {
  
          final boolean isTracingEnabled = TraceComponent.isAnyTracingEnabled();
  
          if (isTracingEnabled && tc.isEntryEnabled()) {
              Tr.entry(this, tc, "setManagedConnection");
          }
  
          if (state == MCWrapper.STATE_NEW || state == MCWrapper.STATE_INACTIVE) {
  
              mc = newMC;
              createdTimeStamp = java.lang.System.currentTimeMillis();
              unusedTimeStamp = createdTimeStamp;
              eventListener = new com.ibm.ejs.j2c.ConnectionEventListener(this);
              mc.addConnectionEventListener(eventListener);
  
              if (isTracingEnabled && tc.isDebugEnabled()) {
                  Tr.debug(this, tc, "Connection created time " + createdTimeStamp + " for mcw " + this.toString());
              }
  
              /*
               * Put the mc and mcw in the hash map
               */
              if (isTracingEnabled && tc.isDebugEnabled()) {
                  Tr.debug(this, tc, "Adding mc and mcw to hashMap " + mc + " in pool manager " + pm.hashCode());
              }
  
              pm.putMcToMCWMap(mc, this); //  moved here from MCWrapperPool.java
  
          } else {
              IllegalStateException e = new IllegalStateException("setManagedConnection: illegal state exception. State = " + getStateString() + " MCW = "
                                                                  + mcWrapperObject_hexString);
              Tr.error(tc, "ILLEGAL_STATE_EXCEPTION_J2CA0079", "setManagedConnection", e);
              throw e;
          }
  
          state = MCWrapper.STATE_ACTIVE_FREE;
  
          if (isTracingEnabled && tc.isEntryEnabled()) {
              Tr.exit(this, tc, "setManagedConnection");
          }
  
      }