code: @Override
      public void enlist() throws ResourceException {
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(this, tc, "enlist");
          }
  
          if (!enlisted) { 
              try {
                  int branchCoupling = mcWrapper.getCm().getResourceRefInfo().getBranchCoupling();
                  int startFlag = javax.transaction.xa.XAResource.TMNOFLAGS;
  
                  if (branchCoupling != ResourceRefInfo.BRANCH_COUPLING_UNSET) {
                      startFlag = mcWrapper.getCm().supportsBranchCoupling(branchCoupling, mcWrapper.get_managedConnectionFactory()); 
                      if (startFlag == -1)
                          throw new ResourceException("Branch coupling attribute not implemented for this resource");
                  }
  
                  mcWrapper.enlistRRSXAResource(mcWrapper.getRecoveryToken(), startFlag);
              } catch (ResourceException re) {
                  throw re;
              } catch (Throwable t) {
                  throw new ResourceException(t);
              }
          }
  
          ManagedConnection mc = mcWrapper.getManagedConnection(); 
          if (mc instanceof WSManagedConnection)
              ((WSManagedConnection) mc).enlistRRS();
  
          // Indicate that the  ManagedConnection that this transaction
          // wrapper is associated with is "dirty" (i.e, the managed
          // connection is involved in the transaction.
          enlisted = true;
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(this, tc, "enlist", enlisted);
          }
  
      }
docs: Enlist
  
  @throws ResourceException (not really, but other wrappers do, so caller
  will be catching ResourceException)
  
  NOTE: In the case of RRSTransactional support, we will simply
  set the enlist indicator on. However, the real enlistment
  on the transaction is actually done by the backend
  Resource Manager. Thus, enlistment is really deferred
  until the backend Resource Manager receives the context
  from the connector at which time it registers an interest
  in the transaction using RRS services.