ic.rebind("java:/" + CONNECTION_FACTORY_JNDI_NAME, cf); ic.rebind("java:/" + XACONNECTION_FACTORY_JNDI_NAME, cf);
   private void setupConnectionFactories() throws Exception   {      ConnectionFactory cf = setupConnectionFactory(null);      InitialContext ic = new InitialContext();            //Bind in global JNDI namespace            ic.rebind(CONNECTION_FACTORY_JNDI_NAME, cf);      ic.rebind(XACONNECTION_FACTORY_JNDI_NAME, cf);            //And now the connection factories and links as required by the TCK      //See section 4.4.15 of the TCK user guide.      //FIXME - these should be removed when connection factories are deployable via mbeans      Context jmsContext = null;      try      {         jmsContext = (Context)ic.lookup("jms");      }      catch (Exception ignore)      {               }      if (jmsContext == null)      {         jmsContext = ic.createSubcontext("jms");      }            jmsContext.rebind("QueueConnectionFactory", cf);      jmsContext.rebind("TopicConnectionFactory", cf);      jmsContext.rebind("DURABLE_SUB_CONNECTION_FACTORY", setupConnectionFactory("cts"));      jmsContext.rebind("MDBTACCESSTEST_FACTORY", setupConnectionFactory("cts1"));      jmsContext.rebind("DURABLE_BMT_CONNECTION_FACTORY", setupConnectionFactory("cts2"));      jmsContext.rebind("DURABLE_CMT_CONNECTION_FACTORY", setupConnectionFactory("cts3"));      jmsContext.rebind("DURABLE_BMT_XCONNECTION_FACTORY", setupConnectionFactory("cts4"));      jmsContext.rebind("DURABLE_CMT_XCONNECTION_FACTORY", setupConnectionFactory("cts5"));      jmsContext.rebind("DURABLE_CMT_TXNS_XCONNECTION_FACTORY", setupConnectionFactory("cts6"));            ic.close();   }