You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fx-dev@ws.apache.org by ja...@apache.org on 2006/10/05 03:26:47 UTC

svn commit: r453080 - in /webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha: Constants.java SandeshaContext.java

Author: jaliya
Date: Wed Oct  4 18:26:46 2006
New Revision: 453080

URL: http://svn.apache.org/viewvc?view=rev&rev=453080
Log:
Applied a patch containing the logic to immediately cleanup the inbound sequences if required

Modified:
    webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/Constants.java
    webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/SandeshaContext.java

Modified: webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/Constants.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/Constants.java?view=diff&rev=453080&r1=453079&r2=453080
==============================================================================
--- webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/Constants.java (original)
+++ webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/Constants.java Wed Oct  4 18:26:46 2006
@@ -72,6 +72,10 @@
 
     int SYNCHRONOUS = 0;
 
+    // Flags for controlling the behavior of endSequence() in the face of incomplete sequences.
+    int END_SEQ_BLOCK_ON_INCOMPLETE = 0;        // default
+    int END_SEQ_IGNORE_INCOMPLETE = 1;          // ignore any active seqs
+
     public interface WSA {
         String NS_ADDRESSING_ANONYMOUS = AddressingUtils.getAnonymousRoleURI();
     }
@@ -165,7 +169,7 @@
         String PROVIDER_RECEIVED_MSG = "INFO: RMPROVIDER RECEIVED A SOAP REQUEST....\n";
         String SENDER_STARTED = "INFO: SENDER STARTED ....\n";
         String WAITING_TO_STOP_CLIENT = "INFO: WATING TO STOP CLIENT ....\n";
-
+        String IGNORING_INCOMPLETE_SEQUENCE = "INFO: IGNORING INCOMPLETE SEQUENCE: ";
     }
 
     //Constants related to the queue.

Modified: webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/SandeshaContext.java
URL: http://svn.apache.org/viewvc/webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/SandeshaContext.java?view=diff&rev=453080&r1=453079&r2=453080
==============================================================================
--- webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/SandeshaContext.java (original)
+++ webservices/sandesha/branches/sandesha_1_0/src/org/apache/sandesha/SandeshaContext.java Wed Oct  4 18:26:46 2006
@@ -76,6 +76,7 @@
     private boolean sendOffer;
     private long messageNumber;
     private boolean sync;
+    private int endSeqIncompleteBehavior;
 
     static int clientListnerPort = -1;
     public final int MIN_PORT = 0;
@@ -155,6 +156,14 @@
         this.toURL = toURL;
     }
 
+    public int getEndSeqBehavior() {
+        return endSeqIncompleteBehavior;
+    }
+
+    public void setEndSeqBehavior(int flag) {
+        this.endSeqIncompleteBehavior = flag;
+    }
+
     public SandeshaContext() throws AxisFault {
         initSandeshaAsync();
     }
@@ -340,18 +349,35 @@
             String key = (String) ite.next();
             Call tempCall = (Call) callMap.get(key);
             String seqId = (String) tempCall.getProperty(Constants.ClientProperties.CALL_KEY);
-            while (!storageManager.isSequenceComplete(seqId)) {
-                try {
-                    if (log.isDebugEnabled()) {
-                        log.debug(Constants.InfomationMessage.WAITING_TO_STOP_CLIENT);
+            while (!storageManager.isSequenceComplete(seqId))
+            {
+                // figure what to do about "incomplete" sequence
+                if (endSeqIncompleteBehavior != Constants.END_SEQ_IGNORE_INCOMPLETE)
+                {
+                    // wait a bit
+                    try {
+                        if (log.isDebugEnabled()) {
+                            log.debug(Constants.InfomationMessage.WAITING_TO_STOP_CLIENT);
+                        }
+                        Thread.sleep(Constants.CLIENT_WAIT_PERIOD_FOR_COMPLETE);
+                        if ((System.currentTimeMillis() - startingTime) >= inactivityTimeOut) {
+                            stopClientByForce();
+                            this.report.setError("Inactivity Time Out Reached. Sequence not complete");
+                        }
+                    } catch (InterruptedException e) {
+                        log.error("",e);
                     }
-                    Thread.sleep(Constants.CLIENT_WAIT_PERIOD_FOR_COMPLETE);
-                    if ((System.currentTimeMillis() - startingTime) >= inactivityTimeOut) {
-                        stopClientByForce();
-                        this.report.setError("Inactivity Time Out Reached. Sequence not complete");
+                }
+                else
+                {
+                    if (log.isInfoEnabled())
+                    {
+                    	String msg = Constants.InfomationMessage.IGNORING_INCOMPLETE_SEQUENCE + seqId;
+                        log.info(msg);
                     }
-                } catch (InterruptedException e) {
-                    log.error("",e);
+                    
+                    // break out to the next sequence
+                    break;
                 }
             }
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: sandesha-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: sandesha-dev-help@ws.apache.org