You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by bh...@apache.org on 2012/01/23 22:09:12 UTC

svn commit: r1234986 - /uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/UimacppAnalysisEngineImpl.java

Author: bhavani
Date: Mon Jan 23 21:09:11 2012
New Revision: 1234986

URL: http://svn.apache.org/viewvc?rev=1234986&view=rev
Log:
UIMA-2117 Modified to get the correct View to pass to sofa unaware C++ component.  

Modified:
    uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/UimacppAnalysisEngineImpl.java

Modified: uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/UimacppAnalysisEngineImpl.java
URL: http://svn.apache.org/viewvc/uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/UimacppAnalysisEngineImpl.java?rev=1234986&r1=1234985&r2=1234986&view=diff
==============================================================================
--- uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/UimacppAnalysisEngineImpl.java (original)
+++ uima/uimaj/trunk/uimaj-core/src/main/java/org/apache/uima/analysis_engine/impl/UimacppAnalysisEngineImpl.java Mon Jan 23 21:09:11 2012
@@ -41,6 +41,7 @@ import org.apache.uima.cas.admin.CASMgr;
 import org.apache.uima.cas.impl.CASImpl;
 import org.apache.uima.collection.CasConsumerDescription;
 import org.apache.uima.impl.UimaContext_ImplBase;
+import org.apache.uima.impl.Util;
 import org.apache.uima.internal.util.UUIDGenerator;
 import org.apache.uima.jcas.JCas;
 import org.apache.uima.resource.ResourceConfigurationException;
@@ -274,11 +275,13 @@ public class UimacppAnalysisEngineImpl e
         // access
         enableProhibitedAnnotatorCasFunctions(aCAS, false);
 
+        // Get the right view of the CAS. Sofa-aware components get the base CAS.
+        // Sofa-unaware components get whatever is mapped to the _InitialView.   
+        CAS view = Util.getStartingView(aCAS, mSofaAware, getUimaContextAdmin().getComponentInfo());
         // Get the right type of CAS and call the AnalysisComponent's
         // process method
-        CAS baseCas = ((CASImpl) aCAS).getBaseCAS();
         Class<CAS> requiredInterface = mAnnotator.getRequiredCasInterface();
-        AbstractCas casToPass = getCasManager().getCasInterface(baseCas, requiredInterface);
+        AbstractCas casToPass = getCasManager().getCasInterface(view, requiredInterface);
         mAnnotator.process(casToPass);
         getMBean().incrementCASesProcessed();
       } catch (Exception e) {