whitlock    2002/10/01 07:30:53

  Modified:    java/src/org/apache/wsif/util/jms WSIFJMSDestination.java
               java/test/org/apache/wsif/util/jms
                        NativeJMSRequestListener.java
               java/src/org/apache/wsif/providers/jms
                        WSIFOperation_Jms.java
  Log:
  For input-only operations don't set the JMSReplyTo queue
  
  Revision  Changes    Path
  1.9       +18 -10    
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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WSIFJMSDestination.java   25 Sep 2002 12:38:43 -0000      1.8
  +++ WSIFJMSDestination.java   1 Oct 2002 14:30:52 -0000       1.9
  @@ -226,7 +226,7 @@
           try {
               TextMessage msg = session.createTextMessage();
               msg.setText(data);
  -            String s = send(msg, id);
  +            String s = send(msg, id, true);
               Trc.exit(s);
               return s;
           } catch (JMSException je) {
  @@ -260,7 +260,7 @@
           try {
               ObjectMessage msg = session.createObjectMessage();
               msg.setObject(data);
  -            String s = send(msg, id);
  +            String s = send(msg, id, true);
               Trc.exit(s);
               return s;
           } catch (JMSException je) {
  @@ -272,7 +272,9 @@
       /**
        * Sends a message to the write queue.
        */
  -    public String send(Message msg, String id) throws WSIFException {
  +    public String send(Message msg, String id, boolean setReplyTo)
  +        throws WSIFException {
  +
           Trc.entry(this, msg, id);
           areWeClosed();
   
  @@ -283,17 +285,23 @@
               if (sender == null)
                   sender = session.createSender(writeQ);
   
  -            // 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);
  +            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
  -                setReplyToQueue();
  +                inProps.remove(WSIFJMSConstants.REPLY_TO);
   
               if (id != null)
                   msg.setJMSCorrelationID(id);
  -            msg.setJMSReplyTo(readQ);
  +            if (setReplyTo)
  +                msg.setJMSReplyTo(readQ);
               inProps.set(sender, msg);
   
               sender.send(msg);
  
  
  
  1.11      +15 -7     
xml-axis-wsif/java/test/org/apache/wsif/util/jms/NativeJMSRequestListener.java
  
  Index: NativeJMSRequestListener.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/test/org/apache/wsif/util/jms/NativeJMSRequestListener.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- NativeJMSRequestListener.java     27 Aug 2002 10:24:07 -0000      1.10
  +++ NativeJMSRequestListener.java     1 Oct 2002 14:30:52 -0000       1.11
  @@ -366,30 +366,38 @@
       }
       
       private void sendReply(Message msg, Object response) throws Exception {
  +        Queue replyTo = (Queue) (msg.getJMSReplyTo());
  +        if (replyTo == null)
  +            return;
  +
           Message replyMsg = session.createObjectMessage();
           ((ObjectMessage) replyMsg).setObject((Serializable) response);
   
  -        setEchoProperties( msg, replyMsg );
  -        
  -        setReplyToQueue((Queue)(msg.getJMSReplyTo()));
  +        setEchoProperties(msg, replyMsg);
  +
  +        setReplyToQueue(replyTo);
           String o = msg.getJMSMessageID();
           try {
  -           send(replyMsg, o);
  +            send(replyMsg, o, false);
           } catch (Exception ex) {
  -             ex.printStackTrace();
  +            ex.printStackTrace();
           }
       }
   
       private void sendReply(Message msg, String response) throws Exception {
  +        Queue replyTo = (Queue) (msg.getJMSReplyTo());
  +        if (replyTo == null)
  +            return;
  +
           Message replyMsg = session.createTextMessage();
           ((TextMessage) replyMsg).setText( response );
   
           setEchoProperties( msg, replyMsg );
           
  -        setReplyToQueue((Queue)(msg.getJMSReplyTo()));
  +        setReplyToQueue(replyTo);
           String o = msg.getJMSMessageID();
           try {
  -           send(replyMsg, o);
  +           send(replyMsg, o, false);
           } catch (Exception ex) {
                ex.printStackTrace();
           }
  
  
  
  1.28      +1 -1      
xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java
  
  Index: WSIFOperation_Jms.java
  ===================================================================
  RCS file: 
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/jms/WSIFOperation_Jms.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- WSIFOperation_Jms.java    27 Sep 2002 09:03:16 -0000      1.27
  +++ WSIFOperation_Jms.java    1 Oct 2002 14:30:53 -0000       1.28
  @@ -464,7 +464,7 @@
           // The basis is off the handler - if handler is defined, we start up the 
listener
           if (isAsyncOperation() && handler != null)
               jmsDest.setAsyncMode(true);
  -        correlId = jmsDest.send(jmsMessage, null);
  +        correlId = jmsDest.send(jmsMessage, null, !inputOnlyOp);
   
           return correlId;
   
  
  
  


Reply via email to