You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by ea...@apache.org on 2008/11/06 21:34:46 UTC

svn commit: r711968 - in /incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae: controller/ handler/input/

Author: eae
Date: Thu Nov  6 12:34:34 2008
New Revision: 711968

URL: http://svn.apache.org/viewvc?rev=711968&view=rev
Log:
UIMA-1166 apply Burn's UIMA-1166-2.patch

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

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java?rev=711968&r1=711967&r2=711968&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/AggregateAnalysisEngineController_impl.java Thu Nov  6 12:34:34 2008
@@ -1813,27 +1813,16 @@
       
 		try
 		{
-			Set keys = destinationMap.keySet();
-			Iterator it = keys.iterator();
-			Endpoint_impl endpoint = null;
-			String key = null;
-			//	Find an endpoint for the GetMeta reply. To succeed, match the endpoint (queue) name
-			//	as well as the server URI. We allow endpoints managed by different servers to have
-			//	the same queue name.
-			//	iterate over all endpoints until a match [queue,server] is found.
-			while( it.hasNext())
-			{
-				key = (String)it.next();
-				Endpoint_impl endp = (Endpoint_impl) destinationMap.get(key);
-
-				if ( endp.getServerURI() != null && endp.getServerURI().equalsIgnoreCase(fromServer) && endp.getEndpoint().equalsIgnoreCase(fromDestination))
-				{
-					endpoint = endp;
-					break;
-				}
-				
-			}
-
+      // Find the endpoint for this service, given its input queue name and broker URI.
+      // We now allow endpoints managed by different servers to have the same queue name.
+      // But if the external name of the broker is unknown (i.e. an old 2.2.2 service)
+      // then use just the queue name, i.e. queue names must be unique for 2.2.2
+      Endpoint_impl endpoint = null;
+      String key = lookUpDelegateKey(fromDestination, fromServer);
+      if (key != null) {
+        endpoint = (Endpoint_impl) destinationMap.get(key);
+      }
+	
 			if (endpoint == null)
 			{
 				// Log invalid reply and move on

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/MetadataResponseHandler_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/MetadataResponseHandler_impl.java?rev=711968&r1=711967&r2=711968&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/MetadataResponseHandler_impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/MetadataResponseHandler_impl.java Thu Nov  6 12:34:34 2008
@@ -69,15 +69,11 @@
 						String fromServer = null;
 						if ( ((MessageContext)anObjectToHandle).propertyExists(AsynchAEMessage.EndpointServer))
 						{
-							
 							fromServer =((MessageContext)anObjectToHandle).getMessageStringProperty(AsynchAEMessage.EndpointServer); 
-
-						}
-						else if ( ((MessageContext)anObjectToHandle).propertyExists(UIMAMessage.ServerURI)) 
-						{
-							fromServer = ((MessageContext)anObjectToHandle).getMessageStringProperty(UIMAMessage.ServerURI);
 						}
-						((AggregateAnalysisEngineController) getController()).mergeTypeSystem(analysisEngineMetadata, fromEndpoint, fromServer);
+						// If old service does not echo back the external broker name then the queue name must be unique. 
+						// The ServerURI set by the service may be its local name for the broker, e.g. tcp://localhost:61616
+ 						((AggregateAnalysisEngineController) getController()).mergeTypeSystem(analysisEngineMetadata, fromEndpoint, fromServer);
 					}
 				}
 				else

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.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/ProcessResponseHandler.java?rev=711968&r1=711967&r2=711968&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/handler/input/ProcessResponseHandler.java Thu Nov  6 12:34:34 2008
@@ -605,15 +605,11 @@
 				if ( ((Endpoint)messageContext.getEndpoint()).isRemote() )
 				{
 					if ( ((MessageContext)anObjectToHandle).propertyExists(AsynchAEMessage.EndpointServer))
-					{
-						
+					{						
 						fromServer =((MessageContext)anObjectToHandle).getMessageStringProperty(AsynchAEMessage.EndpointServer); 
-
-					}
-					else if ( ((MessageContext)anObjectToHandle).propertyExists(UIMAMessage.ServerURI)) 
-					{
-						fromServer = ((MessageContext)anObjectToHandle).getMessageStringProperty(UIMAMessage.ServerURI);
 					}
+					// If old service does not echo back the external broker name then the queue name must be unique. 
+					// Can't use the ServerURI set by the service as it may be its local name for the broker, e.g. tcp://localhost:61616
 				}
 
 				key = ((AggregateAnalysisEngineController)getController()).lookUpDelegateKey(delegate, fromServer);