code: public void open(final String queueName) throws NotificationException {
      try {
        final ConnectionFactory connFactory;
  
        final Context ctx = new InitialContext(pr);
        /*
        try {
          Context jcectx = (Context)ctx.lookup("java:comp/env/");
  
          // Still here - use that
          if (jcectx != null) {
            ctx = jcectx;
          }
        } catch (NamingException nfe) {
          // Stay with root
        }
        */
  
        try {
          connFactory = (ConnectionFactory)ctx.lookup(
                      pr.getProperty("org.bedework.connection.factory.name"));
  
  //        connFactory = (ConnectionFactory)ctx.lookup(connFactoryName);
  
          connection = connFactory.createConnection();
  
        } catch (final Throwable t) {
          if (debug()) {
            error(t);
          }
          throw new NotificationException(t);
        }
  
        try {
          /* Session is not transacted,
          * uses AUTO_ACKNOWLEDGE for message
          * acknowledgement
          */
          session = connection.createSession(useTransactions, ackMode);
          if (session == null) {
            throw new NotificationException("No session created");
          }
          final String qn = pr.getProperty("org.bedework.jms.queue.prefix") +
                  queueName;
  
          try {
            ourQueue =  (Queue)new InitialContext().lookup(qn);
          } catch (final NamingException ne) {
            // Try again with our own context
            ourQueue =  (Queue)ctx.lookup(qn);
          }
        } catch (final Throwable t) {
          if (debug()) {
            error(t);
          }
          throw new NotificationException(t);
        }
      } catch (final NotificationException ne) {
        throw ne;
      } catch (final Throwable t) {
        if (debug()) {
          error(t);
        }
        throw new NotificationException(t);
      }
    }
docs: Open a connection to the named queue ready to create a producer or
  consumer.
  
  @param queueName the queue
  @throws NotificationException