Author: cwiklik
Date: Mon May 17 17:40:32 2010
New Revision: 945266

URL: http://svn.apache.org/viewvc?rev=945266&view=rev
Log:
UIMA-1786 modified handleProcessReplyFromCasMultiplier() to send free cas 
request before checking if the CAS has already expired due to a previous 
timeout.

Modified:
    
uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java

Modified: 
uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
URL: 
http://svn.apache.org/viewvc/uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java?rev=945266&r1=945265&r2=945266&view=diff
==============================================================================
--- 
uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
 (original)
+++ 
uima/uima-as/trunk/uimaj-as-jms/src/main/java/org/apache/uima/adapter/jms/client/BaseUIMAAsynchronousEngineCommon_impl.java
 Mon May 17 17:40:32 2010
@@ -1214,27 +1214,6 @@ public abstract class BaseUIMAAsynchrono
     // exists in the client's cache.
     // Fetch the input CAS Reference Id from which the CAS being processed was 
generated from
     String inputCasReferenceId = 
message.getStringProperty(AsynchAEMessage.InputCasReference);
-    // Fetch an entry from the client cache for a given input CAS id. This 
would be an id
-    // of the CAS that the client sent out to the service.
-    ClientRequest inputCasCachedRequest = (ClientRequest) 
clientCache.get(inputCasReferenceId);
-    if (inputCasCachedRequest == null) {
-      if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
-        // Most likely expired message. Already handled as timeout. Discard 
the message and move on
-        // to the next
-        UIMAFramework.getLogger(CLASS_NAME).logrb(
-                Level.INFO,
-                CLASS_NAME.getName(),
-                "handleProcessReplyFromCasMultiplier",
-                JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
-                "UIMAJMS_received_expired_msg_INFO",
-                new Object[] { 
message.getStringProperty(AsynchAEMessage.MessageFrom),
-                    message.getStringProperty(AsynchAEMessage.CasReference) });
-      }
-      return;
-    }
-    if (inputCasCachedRequest.isSynchronousInvocation()) {
-      handleProcessReplyFromSynchronousCall(inputCasCachedRequest, message);
-    }
     // Fetch the destination for Free CAS notification
     Destination freeCASNotificationDestination = message.getJMSReplyTo();
     if (freeCASNotificationDestination != null) {
@@ -1267,6 +1246,28 @@ public abstract class BaseUIMAAsynchrono
         }
       }
     }
+    
+    // Fetch an entry from the client cache for a given input CAS id. This 
would be an id
+    // of the CAS that the client sent out to the service.
+    ClientRequest inputCasCachedRequest = (ClientRequest) 
clientCache.get(inputCasReferenceId);
+    if (inputCasCachedRequest == null) {
+      if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
+        // Most likely expired message. Already handled as timeout. Discard 
the message and move on
+        // to the next
+        UIMAFramework.getLogger(CLASS_NAME).logrb(
+                Level.INFO,
+                CLASS_NAME.getName(),
+                "handleProcessReplyFromCasMultiplier",
+                JmsConstants.JMS_LOG_RESOURCE_BUNDLE,
+                "UIMAJMS_received_expired_msg_INFO",
+                new Object[] { 
message.getStringProperty(AsynchAEMessage.MessageFrom),
+                    message.getStringProperty(AsynchAEMessage.CasReference) });
+      }
+      return;
+    }
+    if (inputCasCachedRequest.isSynchronousInvocation()) {
+      handleProcessReplyFromSynchronousCall(inputCasCachedRequest, message);
+    }
     CAS cas = null;
     if (message instanceof TextMessage) {
       cas = deserializeCAS(((TextMessage) message).getText(), SHADOW_CAS_POOL);


Reply via email to