/** * {@inheritDoc} */ @Override public <T extends AbstractCas> T getEmptyCas( final Class<T> var1 ) { return _delegate.getEmptyCas( var1 ); }
protected CAS getEmptyCAS() { return uimaContext.getEmptyCas(CAS.class); }
/** * Gets an empty CAS that this CAS Multiplier can then populate. * * @return an empty CAS */ protected final CAS getEmptyCAS() { return getContext().getEmptyCas(CAS.class); }
/** * Gets an empty JCas that this CAS Multiplier can then populate. * * @return an empty JCas */ protected final JCas getEmptyJCas() { return getContext().getEmptyCas(JCas.class); } }
public AbstractCas next() throws AnalysisEngineProcessException { // get a new CAS CAS cas = mUimaContext.getEmptyCas(CAS.class); // check if type system changed; if so, notify CollectionReader checkTypeSystemChange(cas); // Get the right view of the CAS. Sofa-aware components get the base CAS. // Sofa-unaware components get whatever is mapped to the default text sofa. CAS view = ((CASImpl) cas).getBaseCAS(); if (!mSofaAware) { view = cas.getView(CAS.NAME_DEFAULT_SOFA); } try { mCollectionReader.getNext(view); } catch (CollectionException e) { throw new AnalysisEngineProcessException(e); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } return cas; }
outView = getContext().getEmptyCas(CAS.class);
/** * Forces initialization of a Cas Pool if this is a Cas Multiplier delegate collocated with an * aggregate. The parent aggregate calls this method when all type systems have been merged. */ public synchronized void onInitialize() { // Component's Cas Pool is registered lazily, when the process() is called for // the first time. For monitoring purposes, we need the comoponent's Cas Pool // MBeans to register during initialization of the service. For a Cas Multiplier // force creation of the Cas Pool and registration of a Cas Pool with the JMX Server. // Just get the CAS and release it back to the component's Cas Pool. if (isCasMultiplier() && !isTopLevelComponent() ) { boolean isUimaAggregate = false; if ( !(resourceSpecifier instanceof CollectionReaderDescription) ) { // determine if this AE is a UIMA aggregate isUimaAggregate = ((AnalysisEngineDescription) resourceSpecifier).isPrimitive() == false ? true : false; } if ( !isUimaAggregate ) { // !uima core aggregate CM CAS cas = (CAS) getUimaContext().getEmptyCas(CAS.class); cas.release(); } } }