You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by wh...@apache.org on 2002/10/08 10:58:06 UTC

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

whitlock    2002/10/08 01:58:06

  Modified:    java/src/org/apache/wsif/util/jms WSIFJMSDestination.java
  Log:
  Always set JMSReplyTo if it is explicitly set in the WSDL or in the context
  
  Revision  Changes    Path
  1.10      +19 -15    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.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WSIFJMSDestination.java	1 Oct 2002 14:30:52 -0000	1.9
  +++ WSIFJMSDestination.java	8 Oct 2002 08:58:06 -0000	1.10
  @@ -271,6 +271,11 @@
   
       /**
        * Sends a message to the write queue.
  +     * @param message
  +     * @param id Correlation id
  +     * @param setReplyTo If true JMSReplyTo is always set. If false JMSReplyTo 
  +     *                    is only set if the ReplyTo was explicitly set as a 
  +     *                    property.
        */
       public String send(Message msg, String id, boolean setReplyTo)
           throws WSIFException {
  @@ -285,23 +290,20 @@
               if (sender == null)
                   sender = session.createSender(writeQ);
   
  -            if (setReplyTo) {
  -                // Process replyTo queues separately since they are not 
  -                // ordinary JMS properties.
  -                if (inProps.containsKey(WSIFJMSConstants.REPLY_TO)) {
  -                    String rto =
  -                        (String) inProps.get(WSIFJMSConstants.REPLY_TO);
  -                    setReplyToQueue(rto);
  -                    inProps.remove(WSIFJMSConstants.REPLY_TO);
  -                } else
  -                    setReplyToQueue();
  -            } else
  +            // Process replyTo queues separately since they are not 
  +            // ordinary JMS properties.
  +            if (inProps.containsKey(WSIFJMSConstants.REPLY_TO)) {
  +                String rto = (String) inProps.get(WSIFJMSConstants.REPLY_TO);
  +                setReplyToQueue(rto);
                   inProps.remove(WSIFJMSConstants.REPLY_TO);
  +                msg.setJMSReplyTo(readQ);
  +            } else if (setReplyTo) {
  +                setReplyToQueue();
  +                msg.setJMSReplyTo(readQ);
  +            }
   
               if (id != null)
                   msg.setJMSCorrelationID(id);
  -            if (setReplyTo)
  -                msg.setJMSReplyTo(readQ);
               inProps.set(sender, msg);
   
               sender.send(msg);
  @@ -310,7 +312,9 @@
           } catch (JMSException je) {
               Trc.exception(je);
               throw WSIFJMSConstants.ToWsifException(je);
  -        } finally { // If properties were set, trash the sender so we get the default props next time.
  +        } finally {
  +            // If properties were set, trash the sender so 
  +            // we get the default props next time.
               if (propsSet)
                   sender = null;
               inProps.clear();
  @@ -414,8 +418,8 @@
               throw WSIFJMSConstants.ToWsifException(je);
           }
   
  -        readQ = syncTempQueue;
           // So we don't overwrite readQ if there was an error.
  +        readQ = syncTempQueue;
           replyToName = null;
           Trc.exit();
       }