コード例 #1
0
  /**
   * Get the JMS reply destination specified by the given URL from the context
   *
   * @param context the Context to lookup
   * @param url URL
   * @return the JMS destination, or null if it does not exist
   */
  private Destination getReplyDestination(Context context, String url) {
    String replyDestinationName = properties.get(JMSConstants.PARAM_REPLY_DESTINATION);
    if (log.isDebugEnabled()) {
      log.debug(
          "Lookup the JMS destination "
              + replyDestinationName
              + " of type "
              + replyDestinationType
              + " extracted from the URL "
              + JMSUtils.maskURLPasswordAndCredentials(url));
    }

    try {
      return JMSUtils.lookupDestination(context, replyDestinationName, replyDestinationType);
    } catch (NamingException e) {
      handleException(
          "Couldn't locate the JMS destination "
              + replyDestinationName
              + " of type "
              + replyDestinationType
              + " extracted from the URL "
              + JMSUtils.maskURLPasswordAndCredentials(url),
          e);
    }

    // never executes but keeps the compiler happy
    return null;
  }
コード例 #2
0
  /**
   * Get the JMS destination specified by the given URL from the context
   *
   * @param context the Context to lookup
   * @param url URL
   * @return the JMS destination, or null if it does not exist
   */
  private Destination getDestination(Context context, String url) {
    String destinationName = JMSUtils.getDestination(url);
    if (log.isDebugEnabled()) {
      log.debug(
          "Lookup the JMS destination "
              + destinationName
              + " of type "
              + destinationType
              + " extracted from the URL "
              + JMSUtils.maskURLPasswordAndCredentials(url));
    }

    try {
      return JMSUtils.lookupDestination(context, destinationName, destinationType);
    } catch (NamingException e) {
      handleException(
          "Couldn't locate the JMS destination "
              + destinationName
              + " of type "
              + destinationType
              + " extracted from the URL "
              + JMSUtils.maskURLPasswordAndCredentials(url),
          e);
    }

    // never executes but keeps the compiler happy
    return null;
  }
コード例 #3
0
  /**
   * Look up for the given destination
   *
   * @param replyDest the JNDI name to lookup Destination required
   * @return Destination for the JNDI name passed
   */
  public Destination getReplyDestination(String replyDest) {
    if (log.isDebugEnabled()) {
      log.debug("Lookup the JMS destination " + replyDest + " of type " + replyDestinationType);
    }

    try {
      return JMSUtils.lookupDestination(
          jmsConnectionFactory.getContext(), replyDest, replyDestinationType);
    } catch (NamingException e) {
      handleException(
          "Couldn't locate the JMS destination " + replyDest + " of type " + replyDestinationType,
          e);
    }

    // never executes but keeps the compiler happy
    return null;
  }