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/02/24 22:20:34 UTC
svn commit: r747553 -
/incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
Author: cwiklik
Date: Tue Feb 24 21:20:34 2009
New Revision: 747553
URL: http://svn.apache.org/viewvc?rev=747553&view=rev
Log:
UIMA-1293 - modified code in the process() method that decides whether not to return input CAS to the client
Modified:
incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java
Modified: incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_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/PrimitiveAnalysisEngineController_impl.java?rev=747553&r1=747552&r2=747553&view=diff
==============================================================================
--- incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java (original)
+++ incubator/uima/sandbox/trunk/uima-as/uimaj-as-core/src/main/java/org/apache/uima/aae/controller/PrimitiveAnalysisEngineController_impl.java Tue Feb 24 21:20:34 2009
@@ -442,7 +442,6 @@
parentCasStateEntry = parentController.getLocalCache().lookupEntry(aCasReferenceId);
} else {
childCasStateEntry = getLocalCache().createCasStateEntry(newEntry.getCasReferenceId());
- parentCasStateEntry = getLocalCache().lookupEntry(aCasReferenceId);
}
// Associate parent CAS (input CAS) with the new CAS.
childCasStateEntry.setInputCasReferenceId(aCasReferenceId);
@@ -535,28 +534,16 @@
}
else
{
- boolean sendReply = false;
- synchronized( cmOutstandingCASes )
- {
- if ( cmOutstandingCASes.size() == 0)
- {
- inputCASReturned = true;
- sendReply = true;
- }
- else
- {
- // Change the state of the input CAS. Since the input CAS is not returned to the client
- // until all children of this CAS has been fully processed we keep the input in the cache.
- // The client will send Free CAS Notifications to release CASes produced here. When the
- // last child CAS is freed, the input CAS is allowed to be returned to the client.
- inputCASEntry.setPendingReply(true);
- }
- }
- if ( sendReply )
- {
- // Return an input CAS to the client if there are no outstanding child CASes in play
- getOutputChannel().sendReply(aCasReferenceId, anEndpoint);
- }
+ if (parentCasStateEntry.getSubordinateCasInPlayCount()==0) {
+ inputCASReturned = true;
+ getOutputChannel().sendReply(aCasReferenceId, anEndpoint);
+ } else {
+ // Change the state of the input CAS. Since the input CAS is not returned to the client
+ // until all children of this CAS has been fully processed we keep the input in the cache.
+ // The client will send Free CAS Notifications to release CASes produced here. When the
+ // last child CAS is freed, the input CAS is allowed to be returned to the client.
+ inputCASEntry.setPendingReply(true);
+ }
}
// Remove input CAS state entry from the local cache
if ( !isTopLevelComponent() ) {