code: public Queue getQueue(String contextUrl, String queueName) throws ServiceLocatorException {
          try {
              String jndiName = null;
              if (contextUrl == null) {
                  jndiName = namingProvider.qualifyJmsQueueName(queueName);
              }
              else {
                  jndiName = queueName; // don't qualify remote queue names
              }
              return (Queue) namingProvider.lookup(contextUrl, jndiName, Queue.class);
          }
          catch (Exception ex) {
              throw new ServiceLocatorException(-1, ex.getMessage(), ex);
          }
      }
docs: Looks up and returns a JMS queue.
  
  @param queueName
  remote queue name
  @param contextUrl
  the context url (or null for local)
  @return javax.jms.Queue