Package org.apache.uima.analysis_engine

Examples of org.apache.uima.analysis_engine.AnalysisEngine.destroy()


        ae = UIMAFramework.produceAnalysisEngine(uriSpec);
      } catch (ResourceInitializationException e) {
        return null;
      }
      AnalysisEngineMetaData aemd = ae.getAnalysisEngineMetaData();
      ae.destroy();
      return aemd;
    }
   
    throw new InternalErrorCDE("invalid call");
  }
View Full Code Here


      AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(rSpecifier, paramsMap);
        //  Call to produceAnalysisEngine() may take a long time to complete. While this
        //  method was executing, the service may have been stopped. Before continuing
        //  check if the service has been stopped. If so, destroy AE instance and return.
        if ( isStopped() ) {
          ae.destroy();
          return;
        }
        if (aeInstancePool == null) {
          aeInstancePool = new AnalysisEngineInstancePoolWithThreadAffinity();//analysisEnginePoolSize);
        }
View Full Code Here

  public void destroyAE()  {
    try {
      if ( aeInstancePool != null ) {
        AnalysisEngine ae = aeInstancePool.checkout();
        if ( ae != null ) {
          ae.destroy();
        }
      }
    } catch( AsynchAEException e) {
      //  No-op. AE instance not found. Most likely, the UIMA AS service is in shutdown state
    } catch( Exception e) {
View Full Code Here

        }
      }

      // cleanup ae and stop global timer
      cleanupTimer.start();
      ae.destroy();
      ae = null;
      cleanupTimer.stop();
      globalTimer.stop();

      // save results
View Full Code Here

        ae = UIMAFramework.produceAnalysisEngine(uriSpec);
      } catch (ResourceInitializationException e) {
        return null;
      }
      AnalysisEngineMetaData aemd = ae.getAnalysisEngineMetaData();
      ae.destroy();
      return aemd;
    }
   
    throw new InternalErrorCDE("invalid call");
  }
View Full Code Here

      // Signal end of processing
      aae.collectionProcessComplete();
    } finally {
      // Destroy
      aae.destroy();
    }
  }

  /**
   * Run the CollectionReader and AnalysisEngines as a pipeline. After processing all CASes provided
View Full Code Here

      // Signal end of processing
      aae.collectionProcessComplete();
    } finally {
      // Destroy
      aae.destroy();
    }
  }

  /**
   * Run a sequence of {@link AnalysisEngine analysis engines} over a {@link JCas}. The result of
View Full Code Here

        AnalysisEngine ae = UIMAFramework.produceAnalysisEngine(rSpecifier, paramsMap);
        //  Call to produceAnalysisEngine() may take a long time to complete. While this
        //  method was executing, the service may have been stopped. Before continuing
        //  check if the service has been stopped. If so, destroy AE instance and return.
        if ( isStopped() ) {
          ae.destroy();
          return;
        }
        if (aeInstancePool == null) {
          aeInstancePool = new AnalysisEngineInstancePoolWithThreadAffinity(analysisEnginePoolSize);
        }
View Full Code Here

    Iterator aeInstanceIterator = aeInstanceMap.keySet().iterator();
    int i = 0;
    while (aeInstanceIterator.hasNext()) {
      AnalysisEngine ae = (AnalysisEngine) aeInstanceMap.get((Long) aeInstanceIterator.next());
      ae.destroy();
      if (UIMAFramework.getLogger(CLASS_NAME).isLoggable(Level.INFO)) {
        UIMAFramework.getLogger(CLASS_NAME).logrb(Level.INFO, getClass().getName(), "abort",
                UIMAEE_Constants.JMS_LOG_RESOURCE_BUNDLE, "UIMAEE_destroying_ae__INFO",
                new Object[] { ae.getAnalysisEngineMetaData().getName(), i });
      }
View Full Code Here

    tcas.setDocumentText("testing...");
    ae.process(tcas, resultSpec);
    assertEquals("testing...", TestAnnotator.lastDocument);
    assertEquals(resultSpec, TestAnnotator.lastResultSpec);
    tcas.reset();
    ae.destroy();
  }

  public void testReconfigure() throws Exception {
    try {
      // create simple primitive TextAnalysisEngine descriptor (using TestAnnotator class)
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.