You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by cw...@apache.org on 2009/07/01 21:23:44 UTC

svn commit: r790329 - /incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java

Author: cwiklik
Date: Wed Jul  1 19:23:44 2009
New Revision: 790329

URL: http://svn.apache.org/viewvc?rev=790329&view=rev
Log:
UIMA-1391 Changed name of the method that processes remote CASes. Added support for sending ProcessInfo message to the client.

Modified:
    incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java?rev=790329&r1=790328&r2=790329&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessRequestHandler_impl.java Wed Jul  1 19:23:44 2009
@@ -318,7 +318,7 @@
 	 * @param aMessageContext - contains a message from UIMA-AS Client
 	 * @throws AsynchAEException
 	 */
-	private void handleProcessRequestFromRemoteDelegate(MessageContext aMessageContext) throws AsynchAEException
+	private void handleProcessRequestFromRemoteClient(MessageContext aMessageContext) throws AsynchAEException
 	{
 		CacheEntry entry = null;
 		String casReferenceId = null;
@@ -407,9 +407,20 @@
 					}
 				}
 			}
-			else if ( getController().isTopLevelComponent() && getController() instanceof AggregateAnalysisEngineController )
+			else if ( getController().isTopLevelComponent() )
 			{
-				((AggregateAnalysisEngineController)getController()).addMessageOrigin(casReferenceId, aMessageContext.getEndpoint());
+			  if ( getController() instanceof AggregateAnalysisEngineController ) {
+	        ((AggregateAnalysisEngineController)getController()).addMessageOrigin(casReferenceId, aMessageContext.getEndpoint());
+			  }
+			  if ( getController().isCasMultiplier() ) {
+			    // Send an ack to the client. The ack message will include a FreeCasQueue  
+			    // to enable the client to send messages to the service processing a CAS.
+			    try {
+	          getController().getOutputChannel().sendReply(AsynchAEMessage.ServiceInfo, aMessageContext.getEndpoint(), casReferenceId);
+			    } catch (Exception e) {
+			      e.printStackTrace();
+			    }
+			  }
 			}
 			//	To prevent processing multiple messages with the same CasReferenceId, check the CAS cache
 			//	to see if the message with a given CasReferenceId is already being processed. It is, the
@@ -471,7 +482,7 @@
 			{
         if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
           UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, CLASS_NAME.getName(),
-		                "handleProcessRequestWithXMI", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_duplicate_request__INFO",
+		                "handleProcessRequestFromRemoteClient", UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_duplicate_request__INFO",
 		                new Object[] { casReferenceId});
         }
 			}
@@ -480,7 +491,7 @@
 		{
 			e.printStackTrace();
       if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.WARNING)) {
-        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(), "handleProcessRequestWithXMI", 
+        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.WARNING, getClass().getName(), "handleProcessRequestFromRemoteClient", 
 					UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_exception__WARNING", e);
       }
 			ErrorContext errorContext = new ErrorContext();
@@ -934,7 +945,7 @@
 					{
 						return; // 	Invalid message. Nothing to do
 					}
-					handleProcessRequestFromRemoteDelegate(messageContext);
+					handleProcessRequestFromRemoteClient(messageContext);
 				}
 				else if (AsynchAEMessage.XCASPayload == payload)
 				{