Author: davidillsley
Date: Mon May 12 09:20:00 2008
New Revision: 655548

URL: http://svn.apache.org/viewvc?rev=655548&view=rev
Log:
Performance: Reduce the complexity of Ack piggybacking for Sync invocations. 
It's clever but entirely unnecessary.

Modified:
    
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java

Modified: 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java
URL: 
http://svn.apache.org/viewvc/webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java?rev=655548&r1=655547&r2=655548&view=diff
==============================================================================
--- 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java
 (original)
+++ 
webservices/sandesha/trunk/java/modules/core/src/main/java/org/apache/sandesha2/util/AcknowledgementManager.java
 Mon May 12 09:20:00 2008
@@ -69,35 +69,17 @@
                // anonymous acksTo, then we add in an ack for the inbound 
sequence.
                EndpointReference target = rmMessageContext.getTo();
                if(target == null || target.hasAnonymousAddress()) {
-                       if(target != null && 
SandeshaUtil.isWSRMAnonymous(target.getAddress())) {
-                               // Search for any sequences that have an acksTo 
that matches this target, and add an ack
-                               // for each of them.
-                               RMDBean findBean = new RMDBean();
-                               findBean.setAcksToEndpointReference(target);
-                               findBean.setTerminated(false);
-                               Collection rmdBeans = 
storageManager.getRMDBeanMgr().find(findBean);
-                               Iterator sequences = rmdBeans.iterator();
-                               while(sequences.hasNext()) {
-                                       RMDBean sequence = (RMDBean) 
sequences.next();
-                                       if 
(sequence.getHighestInMessageNumber() > 0) {
-                                               if(log.isDebugEnabled()) 
log.debug("Piggybacking ack for sequence: " + sequence.getSequenceID());
-                                               
RMMsgCreator.addAckMessage(rmMessageContext, sequence.getSequenceID(), 
sequence, false);
-                                       }
-                               }
-                               
-                       } else {
-                               // We have no good indicator of the identity of 
the destination, so the only sequence
-                               // we can ack is the inbound one that caused us 
to create this response.
-                               String inboundSequence = (String) 
rmMessageContext.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID);
-                               if(inboundSequence != null) {
-                                       RMDBean inboundBean = 
SandeshaUtil.getRMDBeanFromSequenceId(storageManager, inboundSequence);
-                                       if(inboundBean != null && 
!inboundBean.isTerminated()) {
-                                               EndpointReference acksToEPR = 
inboundBean.getAcksToEndpointReference();
-                                               
-                                               if(acksToEPR == null || 
acksToEPR.hasAnonymousAddress()) {
-                                                       
if(log.isDebugEnabled()) log.debug("Piggybacking ack for inbound sequence: " + 
inboundSequence);
-                                                       
RMMsgCreator.addAckMessage(rmMessageContext, inboundSequence, inboundBean, 
false);
-                                               }
+                       // We have no good indicator of the identity of the 
destination, so the only sequence
+                       // we can ack is the inbound one that caused us to 
create this response.
+                       String inboundSequence = (String) 
rmMessageContext.getProperty(Sandesha2Constants.MessageContextProperties.INBOUND_SEQUENCE_ID);
+                       if(inboundSequence != null) {
+                               RMDBean inboundBean = 
SandeshaUtil.getRMDBeanFromSequenceId(storageManager, inboundSequence);
+                               if(inboundBean != null && 
!inboundBean.isTerminated()) {
+                                       EndpointReference acksToEPR = 
inboundBean.getAcksToEndpointReference();
+
+                                       if(acksToEPR == null || 
acksToEPR.hasAnonymousAddress()) {
+                                               if(log.isDebugEnabled()) 
log.debug("Piggybacking ack for inbound sequence: " + inboundSequence);
+                                               
RMMsgCreator.addAckMessage(rmMessageContext, inboundSequence, inboundBean, 
false);
                                        }
                                }
                        }



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

Reply via email to