Author: gatfora
Date: Wed Jul  2 06:09:40 2008
New Revision: 673385

URL: http://svn.apache.org/viewvc?rev=673385&view=rev
Log:
Applying patches from SANDESHA2-166 and SANDESHA2-158

Removed:
    
webservices/sandesha/trunk/java/modules/tests/src/test/java/org/apache/sandesha2/utils/SandeshaUtilTest.java
Modified:
    
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
    
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/polling/PollingManager.java
    
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
    webservices/sandesha/trunk/java/modules/samples/pom.xml

Modified: 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java?rev=673385&r1=673384&r2=673385&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
 (original)
+++ 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/msgprocessors/ApplicationMsgProcessor.java
 Wed Jul  2 06:09:40 2008
@@ -386,59 +386,58 @@
                        // set this as the response highest message.
                        rmsBean.setHighestOutMessageNumber(messageNumber);
                        
-                       // saving the used message number, and the expected 
reply count
-                       boolean startPolling = false;
+                       // saving the used message number
+                       //Save the expected replies if it's not a dummy msg and 
it's an outIn MEP
+                       String specVersion = 
SequenceManager.getSpecVersion(rmMsgCtx.getMessageContext(), storageManager);
                        if (!dummyMessage) {
-                               if (log.isDebugEnabled())
-                                       log.debug("Enter: 
ApplicationMsgProcessor:: not a dummy msg");
                                rmsBean.setNextMessageNumber(messageNumber);
-       
+                               
                                // Identify the MEP associated with the message.
                                AxisOperation op = 
msgContext.getAxisOperation();
                                int mep = WSDLConstants.MEP_CONSTANT_INVALID;
                                if(op != null) {
                                        mep = op.getAxisSpecificMEPConstant();
                                }
-       
-                               if(mep == WSDLConstants.MEP_CONSTANT_OUT_IN) {
+                               
+                               EndpointReference replyTo = 
msgContext.getReplyTo();
+                               
+                               if(mep == WSDLConstants.MEP_CONSTANT_OUT_IN){
                                        // We only match up requests and 
replies when we are doing sync interactions
-                                       if (log.isDebugEnabled()) 
log.debug("MEP OUT_IN");
-                                       EndpointReference replyTo = 
msgContext.getReplyTo();
+                                       if (log.isDebugEnabled()) 
log.debug("MEP OUT_IN");      
                                        if(replyTo == null || 
replyTo.hasAnonymousAddress()) {
                                                long expectedReplies = 
rmsBean.getExpectedReplies();
                                                
rmsBean.setExpectedReplies(expectedReplies + 1);
                                        }
-       
+                                       
                                        // If we support the RM anonymous URI 
then rewrite the ws-a anon to use the RM equivalent.
                                        //(do should be done only for WSRM 1.1)
-                                       
-                                       String specVersion = 
SequenceManager.getSpecVersion(rmMsgCtx.getMessageContext(), storageManager);
                                        if 
(Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion)) {
                                                if (log.isDebugEnabled()) 
log.debug("SPEC_1_1");
                                                String oldAddress = (replyTo == 
null) ? null : replyTo.getAddress();
                                                EndpointReference newReplyTo = 
SandeshaUtil.rewriteEPR(rmsBean, msgContext
                                                                .getReplyTo(), 
configContext);
                                                String newAddress = (newReplyTo 
== null) ? null : newReplyTo.getAddress();
-                                               if (newAddress != null && 
!newAddress.equals(oldAddress)) {
-                                                       // We have rewritten 
the replyTo. If this is the first message that we have needed to
-                                                       // rewrite then we 
should set the sequence up for polling, and once we have saved the
-                                                       // changes to the 
sequence then we can start the polling thread.
-                                                       
-                                                       //Firstly, we are going 
to use make connection in this configuration so we should now ensure that
-                                                       //WS-Adressing is 
enabled
-                                                       if 
(log.isDebugEnabled()) log.debug("Ensuring that WS-A is enabled for msg " + 
msgContext);
-                                                       
msgContext.setProperty(AddressingConstants.DISABLE_ADDRESSING_FOR_OUT_MESSAGES,Boolean.FALSE);
+                                               if(newAddress != null && 
!newAddress.equals(oldAddress)){
                                                        
msgContext.setReplyTo(newReplyTo);
-                                                       
-                                                       //start the polling 
process to pull back response messages
-                                                       if 
(!rmsBean.isPollingMode()) {
-                                                               
rmsBean.setPollingMode(true);
-                                                               startPolling = 
true;
-                                                       }
                                                }
                                        }
                                }
+                       } 
+                       
+                       boolean startPolling = false;
+                       // We should poll for any reply-to that uses the 
anonymous URI, when MakeConnection
+                       // is enabled.
+                       if 
(Sandesha2Constants.SPEC_VERSIONS.v1_1.equals(specVersion)) {
+                               SandeshaPolicyBean policy = 
SandeshaUtil.getPropertyBean(msgContext.getConfigurationContext().getAxisConfiguration());
+                               if(policy.isEnableMakeConnection()) {
+                                       EndpointReference reference = 
rmsBean.getAcksToEndpointReference();
+                                       if(reference == null || 
reference.hasAnonymousAddress()) {
+                                               rmsBean.setPollingMode(true);
+                                               startPolling = true;
+                                       }
+                               }
                        }
+
                        if (log.isDebugEnabled()) log.debug("App msg using 
replyTo EPR as " + msgContext.getReplyTo());
                        
                        RelatesTo relatesTo = msgContext.getRelatesTo();

Modified: 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/polling/PollingManager.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/polling/PollingManager.java?rev=673385&r1=673384&r2=673385&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/polling/PollingManager.java
 (original)
+++ 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/polling/PollingManager.java
 Wed Jul  2 06:09:40 2008
@@ -160,8 +160,14 @@
                        if (beanToPoll.getNextMessageNumber() > -1)
                                cleanAcks = 
AcknowledgementManager.verifySequenceCompletion(beanToPoll.getClientCompletedMessages(),
 beanToPoll.getNextMessageNumber());
                        long  repliesExpected = beanToPoll.getExpectedReplies();
-                       if(beanToPoll.getSequenceID() != null && (force || 
!cleanAcks || repliesExpected > 0) && beanToPoll.getReferenceMessageStoreKey() 
!= null)
-                           pollForSequence(beanToPoll.getAnonymousUUID(), 
beanToPoll.getInternalSequenceID(), beanToPoll.getReferenceMessageStoreKey(), 
beanToPoll, entry);
+                       if(beanToPoll.getSequenceID() != null){
+                               if((force || !cleanAcks || repliesExpected > 0) 
&& beanToPoll.getReferenceMessageStoreKey() != null){
+                                       
pollForSequence(beanToPoll.getAnonymousUUID(), 
beanToPoll.getInternalSequenceID(), beanToPoll.getReferenceMessageStoreKey(), 
beanToPoll, entry);
+                               }
+                       } else {
+                               //If seqID is null on RMS bean then it must be 
an RMSBean waiting for a createSeqResponse and we want to poll for these
+                       pollForSequence(beanToPoll.getAnonymousUUID(), 
beanToPoll.getInternalSequenceID(), beanToPoll.getReferenceMessageStoreKey(), 
beanToPoll, entry);
+                       }
                }
                
 

Modified: 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java?rev=673385&r1=673384&r2=673385&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
 (original)
+++ 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/SandeshaUtil.java
 Wed Jul  2 06:09:40 2008
@@ -975,11 +975,12 @@
                int executionChainLength = executionChain.size();
                for(int i=0;i<executionChainLength;i++){
                        Handler handler = (Handler)executionChain.get(i);
-                       
if("Security".equals(handler.getName())||"MessageOut".equals(handler.getName())){
+                       if("Security".equals(handler.getName())){
                                retransmittablePhases.add(handler);
                        }
                }
                executionChain.removeAll(retransmittablePhases);
+                               
                message.setProperty(Sandesha2Constants.RETRANSMITTABLE_PHASES, 
retransmittablePhases);
        }
        

Modified: webservices/sandesha/trunk/java/modules/samples/pom.xml
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/samples/pom.xml?rev=673385&r1=673384&r2=673385&view=diff
==============================================================================
--- webservices/sandesha/trunk/java/modules/samples/pom.xml (original)
+++ webservices/sandesha/trunk/java/modules/samples/pom.xml Wed Jul  2 06:09:40 
2008
@@ -93,6 +93,11 @@
             <version>${pom.version}</version>
         </dependency>
         <dependency>
+            <groupId>org.apache.axis2</groupId>
+            <artifactId>axis2-transports</artifactId>
+            <version>SNAPSHOT</version>
+        </dependency>
+        <dependency>
             <groupId>org.apache.geronimo.specs</groupId>
             <artifactId>geronimo-activation_1.1_spec</artifactId>
             <version>${geronimo.spec.activation.version}</version>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to