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/30 21:12:00 UTC

svn commit: r799410 - /incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/BaseAnalysisEngineController.java

Author: cwiklik
Date: Thu Jul 30 19:12:00 2009
New Revision: 799410

URL: http://svn.apache.org/viewvc?rev=799410&view=rev
Log:
UIMA-1439 Send STOP message to colocated service when stopping transport

Modified:
    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/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=799410&r1=799409&r2=799410&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 Thu Jul 30 19:12:00 2009
@@ -1775,6 +1775,10 @@
 	    for( Entry<String, UimaTransport> entry: set ) {
 	      UimaTransport transport = entry.getValue();
 	      try {
+	        
+	        UimaMessage message = 
+	          transport.produceMessage(AsynchAEMessage.Stop,AsynchAEMessage.Request,getName());
+	        transport.getUimaMessageDispatcher(entry.getKey()).dispatch(message);
 	        transport.stopIt();
 	        System.out.println(">>> Controller:"+getComponentName()+" Stopped Transport For:"+entry.getKey());
 	      } catch ( Exception e) {e.printStackTrace();}
@@ -1802,7 +1806,8 @@
     }
 		if ( this instanceof PrimitiveAnalysisEngineController )
 		{
-			getControllerLatch().release();
+
+		  getControllerLatch().release();
 			//	Stops the input channel of this service
       stopInputChannels(InputChannel.CloseAllChannels);
 		}
@@ -2019,6 +2024,7 @@
 	
   public void terminate( Throwable cause, String aCasReferenceId) {
 
+    
     synchronized(stopLatch) {
       if ( stopLatch.getCount() > 0 ) {
         if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
@@ -2082,9 +2088,11 @@
           if ( delegate != null ) {
             // Get a list of all CASes this aggregate has dispatched to the Cas Multiplier
             List<DelegateEntry> pendingList = delegate.getDelegateCasesPendingRepy();
-            try {
+            if ( pendingList != null ) {
+              Iterator<DelegateEntry> it2 = pendingList.iterator();
               // For each CAS pending reply send a Stop message to the CM
-              for( DelegateEntry delegateEntry : pendingList ) {
+              while( it2.hasNext() ) {
+                DelegateEntry delegateEntry = it2.next();
                 if ( endpoint.isRemote() ) {
                   stopCasMultiplier(delegate, delegateEntry.getCasReferenceId());
                 } else {
@@ -2092,8 +2100,6 @@
                   delegateCasMultiplier.addAbortedCasReferenceId(delegateEntry.getCasReferenceId());
                 }
               }
-            } catch ( Exception exx) {
-              exx.printStackTrace();
             }
           }
         }