/** * Internal use only, public for crss package access. switches class loaders and locks cas * @param statCL status call back listener * @param cas cas * @param eps entity process status */ public static void callEntityProcessCompleteWithCAS(StatusCallbackListener statCL, CAS cas, EntityProcessStatus eps) { if ( statCL != null ) { try { if (null != cas) ((CASImpl)cas).switchClassLoaderLockCas(statCL); statCL.entityProcessComplete(cas, eps); } finally { if (null != cas) ((CASImpl)cas).restoreClassLoaderUnlockCas(); } } }
public boolean continueOnFailure(String failedAeKey, Exception failure) { try { mCAS.switchClassLoaderLockCasCL(getFlowClassLoader()); return mFlow.continueOnFailure(failedAeKey, failure); } finally { mCAS.restoreClassLoaderUnlockCas(); } }
public void aborted() { try { mCAS.switchClassLoaderLockCasCL(getFlowClassLoader()); mFlow.aborted(); } finally { mCAS.restoreClassLoaderUnlockCas(); } }
((CASImpl)cas).restoreClassLoaderUnlockCas();
public CAS next() throws AnalysisEngineProcessException { enterProcess(); try { // Make sure that the AnalysisComponent has a next CAS to return // Use the saved value so hasNext not called twice before next if (!casAvailable) { throw new UIMA_IllegalStateException(UIMA_IllegalStateException.NO_NEXT_CAS, new Object[0]); } casAvailable = false; // call AnalysisComponent.next method to populate CAS try { CAS cas = callAnalysisComponentNext(); // cas.setParentID(mOriginalCas.getID()); return cas; } catch (Exception e) { ((CASImpl)mInputCas).restoreClassLoaderUnlockCas(); if (e instanceof AnalysisEngineProcessException) { throw (AnalysisEngineProcessException) e; } throw new AnalysisEngineProcessException(e); } } finally { exitProcess(); } }
public boolean hasNext() throws AnalysisEngineProcessException { enterProcess(); if (casAvailable) { return true; } UimaContext prevContext = UimaContextHolder.setContext(getUimaContext()); // for use by POJOs try { casAvailable = mMyAnalysisComponent.hasNext(); if (!casAvailable) { //when hasNext returns false, by contract the AnalysisComponent is done processing its //input CAS. Now is the time to clear the currentComponentInfo to indicate that the //CAS is no longer being processed. mInputCas.setCurrentComponentInfo(null); ((CASImpl)mInputCas).restoreClassLoaderUnlockCas(); } return casAvailable; } catch (Exception e) { ((CASImpl)mInputCas).restoreClassLoaderUnlockCas(); if (e instanceof AnalysisEngineProcessException) { throw (AnalysisEngineProcessException) e; } throw new AnalysisEngineProcessException(e); } finally { UimaContextHolder.setContext(prevContext); exitProcess(); } }
public Step next() throws AnalysisEngineProcessException { mTimer.startIt(); try { mCAS.switchClassLoaderLockCasCL(getFlowClassLoader()); return mFlow.next(); } finally { mCAS.restoreClassLoaderUnlockCas(); mTimer.stopIt(); getMBean().reportAnalysisTime(mTimer.getDuration()); } }
((CASImpl)casToReturn).restoreClassLoaderUnlockCas(); return casToReturn; } catch (Exception e) {
((CASImpl)view).restoreClassLoaderUnlockCas(); ((CASImpl)view).restoreClassLoaderUnlockCas();
newCAS.setCurrentComponentInfo(null); if (null != view) { ((CASImpl)view).restoreClassLoaderUnlockCas();
((CASImpl)view).restoreClassLoaderUnlockCas();