You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-dev@ws.apache.org by an...@apache.org on 2003/03/31 14:34:09 UTC

cvs commit: xml-axis-wsif/java/src/org/apache/wsif/util/jms WSIFJMSDestination.java

antelder    2003/03/31 04:34:09

  Modified:    java/src/org/apache/wsif/util/jms WSIFJMSDestination.java
  Log:
  Move some constants to JMSConstants
  
  Revision  Changes    Path
  1.16      +20 -12    xml-axis-wsif/java/src/org/apache/wsif/util/jms/WSIFJMSDestination.java
  
  Index: WSIFJMSDestination.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/util/jms/WSIFJMSDestination.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WSIFJMSDestination.java	27 Mar 2003 12:21:34 -0000	1.15
  +++ WSIFJMSDestination.java	31 Mar 2003 12:34:09 -0000	1.16
  @@ -700,16 +700,16 @@
           JMSAddress jmsAddress = new JMSAddress();
   
           // validate protocol
  -        if (!url.startsWith(WSIFJMSConstants.jmsURLProtcol)) {
  +        if (!url.startsWith(JMSConstants.JMS_URL_PROTOCOL)) {
               throw new WSIFException(
                   "protocol must be '"
  -                    + WSIFJMSConstants.jmsURLProtcol
  +                    + JMSConstants.JMS_URL_PROTOCOL
                       + "', url: "
                       + url);
           }
   
           // validate its a query
  -        int queryStart = url.indexOf(WSIFJMSConstants.jmsURLQueryChar);
  +        int queryStart = url.indexOf(JMSConstants.JMS_URL_QUERY_CHAR);
           if (queryStart < 1) {
               throw new WSIFException("URL must be a query, url: " + url);
           }
  @@ -717,14 +717,19 @@
           // validate destination type
           String destinationStyle =
               url.substring(
  -                WSIFJMSConstants.jmsURLProtcol.length(),
  +                JMSConstants.JMS_URL_PROTOCOL.length(),
                   queryStart);
  -        if (!JMSConstants.ELEM_JMS_QUEUE.equals(destinationStyle)
  -            && !JMSConstants.ELEM_JMS_TOPIC.equals(destinationStyle)) {
  +        if (!JMSConstants.JMS_URL_QUEUE.equals(destinationStyle)
  +            && !JMSConstants.JMS_URL_TOPIC.equals(destinationStyle)) {
               throw new WSIFException(
  -                "style must be queue or topic. found: " + destinationStyle);
  +                "style must be "
  +                + JMSConstants.JMS_URL_QUEUE
  +                + " or "
  +                + JMSConstants.JMS_URL_TOPIC
  +                + ". found: " 
  +                + destinationStyle);
           }
  -        jmsAddress.setDestStyle(destinationStyle);
  +        jmsAddress.setDestStyle(destinationStyle.substring(1));
   
           // validate query string
           if (queryStart >= url.length()) {
  @@ -732,11 +737,14 @@
           }
           String queryString = url.substring(queryStart + 1);
   
  +        //TODO: this seems a bit nasty
  +        String seperator = JMSConstants.JMS_URL_QUERY_SEPERATOR1;
  +        if (queryString.indexOf(seperator.charAt(0)) < 0) {
  +            seperator = JMSConstants.JMS_URL_QUERY_SEPERATOR2;
  +        }
  +        	
           // parse and validate the query
  -        StringTokenizer st =
  -            new StringTokenizer(
  -                queryString,
  -                WSIFJMSConstants.jmsURLQuerySeperator);
  +        StringTokenizer st = new StringTokenizer(queryString, seperator);
           while (st.hasMoreTokens()) {
               String property = st.nextToken();
               int delim = property.indexOf('=');