axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From antel...@apache.org
Subject cvs commit: xml-axis-wsif/java/src/org/apache/wsif/providers/jms WSIFOperation_Jms.java
Date Mon, 29 Jul 2002 15:05:31 GMT
antelder    2002/07/29 08:05:31

  Modified:    java/src/org/apache/wsif/providers/soap/apacheaxis
                        WSIFJmsSender.java
               java/test/async AsyncTests.java
               java/src/org/apache/wsif/providers/soap/apachesoap
                        SOAPJMSConnection.java
               java/src/org/apache/wsif/providers/jms
                        WSIFOperation_Jms.java
  Log:
  Fix async providers to not use the correlation services when there is no response handler
  
  Revision  Changes    Path
  1.5       +17 -7     xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFJmsSender.java
  
  Index: WSIFJmsSender.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apacheaxis/WSIFJmsSender.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- WSIFJmsSender.java	19 Jul 2002 15:46:31 -0000	1.4
  +++ WSIFJmsSender.java	29 Jul 2002 15:05:31 -0000	1.5
  @@ -131,14 +131,24 @@
               (WSIFOperation_ApacheAxis) messageContext.getProperty(
                   WSIFJmsTransport.WSIFOPERATION);
   
  -       WSIFCorrelationService correlator =
  -          WSIFCorrelationServiceLocator.getCorrelationService();
  -          
  -       synchronized( correlator ) {   
  -          msgID = dest.send( data );
  -          WSIFCorrelationId cid = new WSIFJMSCorrelationId( msgID );
  -          correlator.put( cid, (Serializable)wsifOp, ASYNC_TIMEOUT );
  +        WSIFCorrelationId cid;
  +
  +        // only save op in the correlation service if there's a response handler
  +        if ( wsifOp.getResponseHandler() == null ) {
  +           msgID = dest.send( data );
  +           cid = new WSIFJMSCorrelationId( msgID );
  +        } else {
  +           WSIFCorrelationService correlator = 
  +              WSIFCorrelationServiceLocator.getCorrelationService();
  +           synchronized( correlator ) {   
  +              msgID = dest.send( data );
  +              cid = new WSIFJMSCorrelationId( msgID );
  +              if ( correlator != null ) {
  +                 correlator.put( cid, (Serializable)wsifOp, ASYNC_TIMEOUT );
  +              }
  +           }
           }
  +          
   
           // Save msg ID in the WSIFop for this calling client
           wsifOp.setAsyncRequestID(new WSIFJMSCorrelationId(msgID));
  
  
  
  1.9       +1 -13     xml-axis-wsif/java/test/async/AsyncTests.java
  
  Index: AsyncTests.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/test/async/AsyncTests.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AsyncTests.java	29 Jul 2002 13:38:07 -0000	1.8
  +++ AsyncTests.java	29 Jul 2002 15:05:31 -0000	1.9
  @@ -446,21 +446,9 @@
            op.setContext( context );
            WSIFCorrelationId id = op.executeRequestResponseAsync( input );
            System.out.println( "async operation done, correlation id=" + id.getCorrelationId()
);
  -         op = null;
            
            Object jmsResponse = getJMSResponse( id.getCorrelationId() );
  -         WSIFCorrelationService cs = 
  -            WSIFCorrelationServiceLocator.getCorrelationService();
  -         Object o;
  -         synchronized( cs ) { 
  -            o = cs.get( id ); 
  -         }
  -         if ( o != null && o instanceof WSIFOperation ) {      
  -            cs.remove( id ); 
  -            op = (WSIFOperation)o;
  -         } else {
  -         	assertTrue( "stored correlation object not as expected: " + o, false );
  -         }
  +
            output = op.createOutputMessage();
            WSIFMessage fault = op.createFaultMessage();
            op.processAsyncResponse( jmsResponse, output, fault );
  
  
  
  1.6       +19 -9     xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/SOAPJMSConnection.java
  
  Index: SOAPJMSConnection.java
  ===================================================================
  RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/soap/apachesoap/SOAPJMSConnection.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SOAPJMSConnection.java	19 Jul 2002 15:46:31 -0000	1.5
  +++ SOAPJMSConnection.java	29 Jul 2002 15:05:31 -0000	1.6
  @@ -186,17 +186,27 @@
           env.marshall(payloadSW, smr, ctx);
           WSIFOperation_ApacheSOAP wsifOp = (WSIFOperation_ApacheSOAP) getWsifOperation();
   
  -        WSIFCorrelationService correlator =
  -           WSIFCorrelationServiceLocator.getCorrelationService();
  -           
  -        synchronized( correlator ) {   
  +        WSIFCorrelationId cid;
  +
  +        // only save op in the correlation service if there's a response handler
  +        if ( wsifOp.getResponseHandler() == null ) {
               msgID = destination.send(payloadSW.toString(), null);
  -            WSIFCorrelationId cid = new WSIFJMSCorrelationId( msgID );
  -            correlator.put( 
  -               cid,
  -               (Serializable)getWsifOperation(),
  -               ASYNC_TIMEOUT );
  +            cid = new WSIFJMSCorrelationId( msgID );
  +        } else {
  +           WSIFCorrelationService correlator =
  +              WSIFCorrelationServiceLocator.getCorrelationService();
  +           synchronized( correlator ) {   
  +              msgID = destination.send(payloadSW.toString(), null);
  +              cid = new WSIFJMSCorrelationId( msgID );
  +              if ( correlator != null ) {
  +                 correlator.put( 
  +                    cid,
  +                    (Serializable)getWsifOperation(),
  +                    ASYNC_TIMEOUT );
  +              }
  +           }
           }
  +           
   
           wsifOp.setAsyncRequestID(new WSIFJMSCorrelationId(msgID));
   
  
  
  
  1.16      +8 -5      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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- WSIFOperation_Jms.java	26 Jul 2002 10:52:03 -0000	1.15
  +++ WSIFOperation_Jms.java	29 Jul 2002 15:05:31 -0000	1.16
  @@ -283,12 +283,15 @@
               if ( inputOnlyOp ) {
                  sendJmsMessage(input, jmsDest);
               } else {
  -               // send the jms message	  
  -               WSIFCorrelationService cs = WSIFCorrelationServiceLocator.getCorrelationService();
  -               synchronized( cs ) { 
  +               if ( handler == null ) {	
                     correlId = new WSIFJMSCorrelationId( sendJmsMessage(input, jmsDest) );
  -                  //register it to the correlation service
  -                  cs.put( correlId, this, ASYNC_TIMEOUT );
  +               } else {
  +                  WSIFCorrelationService cs = WSIFCorrelationServiceLocator.getCorrelationService();
  +                  synchronized( cs ) { 
  +                     correlId = new WSIFJMSCorrelationId( sendJmsMessage(input, jmsDest)
);
  +                     //register it to the correlation service
  +                     cs.put( correlId, this, ASYNC_TIMEOUT );
  +                  }
                  }
               }
           } catch (Exception ex) {
  
  
  

Mime
View raw message