コード例 #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;
  }