incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vin...@apache.org
Subject cvs commit: incubator-altrmi/src/java/org/apache/altrmi/client/impl/messenger SynchronousMessengerClientInvocationHandler.java
Date Tue, 22 Apr 2003 04:35:24 GMT
vinayc      2003/04/21 21:35:24

  Modified:    src/java/org/apache/altrmi/client/impl/messenger
                        SynchronousMessengerClientInvocationHandler.java
  Log:
  Adding correlationID from client for correlating responses...
  JMS transport now workzz
  
  Revision  Changes    Path
  1.4       +16 -2     incubator-altrmi/src/java/org/apache/altrmi/client/impl/messenger/SynchronousMessengerClientInvocationHandler.java
  
  Index: SynchronousMessengerClientInvocationHandler.java
  ===================================================================
  RCS file: /home/cvs/incubator-altrmi/src/java/org/apache/altrmi/client/impl/messenger/SynchronousMessengerClientInvocationHandler.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SynchronousMessengerClientInvocationHandler.java	18 Apr 2003 12:57:15 -0000	1.3
  +++ SynchronousMessengerClientInvocationHandler.java	22 Apr 2003 04:35:23 -0000	1.4
  @@ -94,6 +94,8 @@
   
       /** timeout of requests in milliseconds or negative to disable */
       private long timeout = 4000L;
  +	/** JMS correlationid counter */
  +	private	int correlationID=0;
   
       /**
        * Constructor SynchronousMessengerClientInvocationHandler
  @@ -208,18 +210,28 @@
           return reply;
       }
   
  +	/** 
  +	 * Return unique JMSCorrelationID. 
  +	 * @return String correlationID
  +	 */
  +	public String getCorrelationID()
  +	{
  +		return "altrmi-"+correlationID++;
  +	}
  +
       private Reply handleJMSInvocation(Request request)
       {
           try
           {
               ObjectMessage message = m_clientMessenger.createObjectMessage(request);
  +			//set the correlationID
  +			message.setJMSCorrelationID(getCorrelationID());
   
               Message response = (timeout > 0 )
                   ? m_clientMessenger.call(m_destination, message, timeout)
                   : m_clientMessenger.call(m_destination, message);
   
   
  -            System.out.println("<<<< client has received: " + response);
   
               if (response == null)
               {
  @@ -253,4 +265,6 @@
       {
           return m_lastRealRequest;
       }
  +
  +
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message