uima-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From e..@apache.org
Subject svn commit: r726125 - in /incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller: AggregateAnalysisEngineController_impl.java BaseAnalysisEngineController.java
Date Fri, 12 Dec 2008 21:42:51 GMT
Author: eae
Date: Fri Dec 12 13:42:51 2008
New Revision: 726125

URL: http://svn.apache.org/viewvc?rev=726125&view=rev
Log:
UIMA-1223 synchronization problem with the unregisteredDelegateList

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/controller/BaseAnalysisEngineController.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=726125&r1=726124&r2=726125&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
Fri Dec 12 13:42:51 2008
@@ -1986,18 +1986,21 @@
 				//	If getMeta request not yet sent, send meta request to all remote delegate
 				//	Special case when all delegates are remote is handled in the setInputChannel
 
-				if ( requestForMetaSentToRemotes == false && !allDelegatesAreRemote )
-				{
-					String unregisteredDelegateKey = null;
-					for ( int i=0; i < unregisteredDelegateList.size(); i++ )
-					{
-						unregisteredDelegateKey = (String) unregisteredDelegateList.get(i);
-						if ( unregisteredDelegateKey.equals( key ))
-						{
-							unregisteredDelegateList.remove(i);
-						}
-					}
-				}
+        synchronized (unregisteredDelegateList) {
+          //TODO can't find where this list is checked. Is it still used???
+          if ( requestForMetaSentToRemotes == false && !allDelegatesAreRemote )
+          {
+            String unregisteredDelegateKey = null;
+            for ( int i=0; i < unregisteredDelegateList.size(); i++ )
+            {
+              unregisteredDelegateKey = (String) unregisteredDelegateList.get(i);
+              if ( unregisteredDelegateKey.equals( key ))
+              {
+                unregisteredDelegateList.remove(i);
+              }
+            }
+          }
+        }
 
 				
 				//  

Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
URL: http://svn.apache.org/viewvc/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java?rev=726125&r1=726124&r2=726125&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
(original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java
Fri Dec 12 13:42:51 2008
@@ -232,19 +232,21 @@
 			//	Populate a list of un-registered co-located delegates. A delegate will be taken off
the un-registered list
 			//	when it calls its parent registerChildController() method.
 			Set set = aDestinationMap.entrySet();
-			for( Iterator it = set.iterator(); it.hasNext();)
-			{
-				Map.Entry entry = (Map.Entry)it.next();
-				Endpoint endpoint = (Endpoint)entry.getValue();
-				if ( endpoint != null && !endpoint.isRemote() )
-				{
-					unregisteredDelegateList.add(entry.getKey());
-				}
-			}
-			if ( unregisteredDelegateList.size() == 0 ) // All delegates are remote
-			{
-				allDelegatesAreRemote = true;
-			}
+      synchronized (unregisteredDelegateList) {
+        for( Iterator it = set.iterator(); it.hasNext();)
+        {
+          Map.Entry entry = (Map.Entry)it.next();
+          Endpoint endpoint = (Endpoint)entry.getValue();
+          if ( endpoint != null && !endpoint.isRemote() )
+          {
+            unregisteredDelegateList.add(entry.getKey());
+          }
+        }
+        if ( unregisteredDelegateList.size() == 0 ) // All delegates are remote
+        {
+          allDelegatesAreRemote = true;
+        }
+      }
 		}
 
 		
@@ -1706,10 +1708,13 @@
 		{
 			timeSnapshotMap.clear();
 		}
-		if ( unregisteredDelegateList != null )
-		{
-			unregisteredDelegateList.clear();
-		}
+    synchronized (unregisteredDelegateList) {
+      //TODO any reason this list needs to be cleared on Stop???
+      if ( unregisteredDelegateList != null )
+      {
+        unregisteredDelegateList.clear();
+      }
+    }
 		if ( casManager != null )
 		{
 			casManager = null;



Mime
View raw message