code: private JMSContext createJMSContext(JMSContextInfo info, boolean tranIsActive) throws NamingException {
          inTransaction = tranIsActive;
  
          ConnectionFactory cf = (ConnectionFactory) new InitialContext().lookup(info.getConnectionFactoryString());
  
          if (inTransaction && cf instanceof XAConnectionFactory) {
  
              XAJMSContext xaContext = ((XAConnectionFactory) cf).createXAContext(info.getUserName(), info.getPassword());
              return xaContext.getContext();
  
          } else {
  
              return cf.createContext(info.getUserName(), info.getPassword(), info.getAcknowledgeMode());
          }
      }
docs: /*
  Create the JMSContext from the supplied configuration