Package org.apache.uima.cas

Examples of org.apache.uima.cas.AbstractCas


      Class<? extends AbstractCas> casInterface) {
    CASImpl ci = getStartingView(cas, sofaAware, componentInfo);
    // get requested interface to CAS (CAS or JCas)
    // next will create JCas if needed, but not already created
    // must precede the switchClassLoader call - that one needs the JCas link, if it is being used
    AbstractCas r = CasManager_impl.getCasInterfaceStatic(ci, casInterface);
    // This cas will be unlocked and its class loader restored when the
    //   next() method returns it
    // Insure the same view is passed for switching/restoring  https://issues.apache.org/jira/browse/UIMA-2211
    ci.switchClassLoaderLockCasCL(resourceManager.getExtensionClassLoader());   
    return r;
View Full Code Here


      Class<? extends AbstractCas> casInterface) {
    CASImpl ci = getStartingView(cas, sofaAware, componentInfo);
    // get requested interface to CAS (CAS or JCas)
    // next will create JCas if needed, but not already created
    // must precede the switchClassLoader call - that one needs the JCas link, if it is being used
    AbstractCas r = CasManager_impl.getCasInterfaceStatic(ci, casInterface);
    // This cas will be unlocked and its class loader restored when the
    //   next() method returns it
    // Insure the same view is passed for switching/restoring  https://issues.apache.org/jira/browse/UIMA-2211
    ci.switchClassLoader(resourceManager.getExtensionClassLoader());   
    return r;
View Full Code Here

    try {
      view = Util.getStartingView(aCAS, mSofaAware, getUimaContextAdmin().getComponentInfo());

      // now get the right interface(e.g. CAS or JCAS)
      Class<? extends AbstractCas> requiredInterface = mFlowController.getRequiredCasInterface();
      AbstractCas casToPass = getCasManager().getCasInterface(view, requiredInterface);   
      ((CASImpl)view).switchClassLoaderLockCasCL(this.getResourceManager().getExtensionClassLoader());
      Flow flow = mFlowController.computeFlow(casToPass);
      if (flow instanceof CasFlow_ImplBase) {
        ((CasFlow_ImplBase)flow).setCas(view);
      }
View Full Code Here

        // Sofa-unaware components get whatever is mapped to the _InitialView.
        view = Util.getStartingView(aCAS, mSofaAware, getUimaContextAdmin().getComponentInfo());
        // now get the right interface(e.g. CAS or JCAS)
        // must precede the switchClassLoader call below UIMA-2211
        Class<? extends AbstractCas> requiredInterface = mAnalysisComponent.getRequiredCasInterface();
        AbstractCas casToPass = getCasManager().getCasInterface(view, requiredInterface);

        // check if there was a change in the ResultSpecification or in
        // the TypeSystem. If so, set the changed type system into the ResultSpecification and
        // inform the component
        if (mResultSpecChanged || mLastTypeSystem != view.getTypeSystem()) {
View Full Code Here

   * @return CAS returned by the analysis component
   */
  protected CAS callAnalysisComponentNext() throws AnalysisEngineProcessException,
          ResultNotSupportedException {
    try {
      AbstractCas absCas = mAnalysisComponent.next();
      getMBean().incrementCASesProcessed();
      // notify UimaContext that a CAS was returned -- it uses
      // this information to track how many CASes the AnalysisComponent
      // is using at any one time.
      ((UimaContext_ImplBase) getUimaContext()).returnedCAS(absCas);
View Full Code Here

        // 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
        Class<CAS> requiredInterface = mAnnotator.getRequiredCasInterface();
        AbstractCas casToPass = getCasManager().getCasInterface(view, requiredInterface);
        mAnnotator.process(casToPass);
        getMBean().incrementCASesProcessed();
      } catch (Exception e) {
        if (e instanceof AnalysisEngineProcessException) {
          throw e;
View Full Code Here

   * @return CAS returned by the analysis component
   */
  protected CAS callAnalysisComponentNext() throws AnalysisEngineProcessException,
          ResultNotSupportedException {
    try {
      AbstractCas absCas = mAnnotator.next();
      getMBean().incrementCASesProcessed();
      // notify UimaContext that a CAS was returned -- it uses
      // this information to track how many CASes the AnalysisComponent
      // is using at any one time.
      ((UimaContext_ImplBase) getUimaContext()).returnedCAS(absCas);
View Full Code Here

          mSofaAware,
          mFlowControllerContainer.getUimaContextAdmin().getComponentInfo());
      // now get the right interface(e.g. CAS or JCAS)
      // must be done before call to switchClassLoader
      Class<? extends AbstractCas> requiredInterface = mFlowControllerContainer.getRequiredCasInterface();
      AbstractCas casToPass = getCasManager().getCasInterface(view, requiredInterface);

      ((CASImpl)view).switchClassLoaderLockCasCL(getFlowClassLoader());
      Flow flow = mFlow.newCasProduced(casToPass, producedBy);
      if (flow instanceof CasFlow_ImplBase) {
        ((CasFlow_ImplBase)flow).setCas(view);
View Full Code Here

      if (!mSofaAware) {
        view = newCAS.getView(CAS.NAME_DEFAULT_SOFA);
      }
      // now get the right interface(e.g. CAS or JCAS)
      Class<? extends AbstractCas> requiredInterface = mFlowControllerContainer.getRequiredCasInterface();
      AbstractCas casToPass = getCasManager().getCasInterface(view, requiredInterface);

      ((CASImpl)newCAS).switchClassLoaderLockCasCL(getFlowClassLoader());
      Flow flow = mFlow.newCasProduced(casToPass, producedBy);
      if (flow instanceof CasFlow_ImplBase) {
        ((CasFlow_ImplBase)flow).setCas(view);
View Full Code Here

      if (!mSofaAware) {
        view = aCAS.getView(CAS.NAME_DEFAULT_SOFA);
      }
      // now get the right interface(e.g. CAS or JCAS)
      Class<? extends AbstractCas> requiredInterface = mFlowController.getRequiredCasInterface();
      AbstractCas casToPass = getCasManager().getCasInterface(view, requiredInterface);   
      ((CASImpl)aCAS).switchClassLoaderLockCasCL(this.getResourceManager().getExtensionClassLoader());
      Flow flow = mFlowController.computeFlow(casToPass);
      if (flow instanceof CasFlow_ImplBase) {
        ((CasFlow_ImplBase)flow).setCas(view);
      }
View Full Code Here

TOP

Related Classes of org.apache.uima.cas.AbstractCas

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.