Examples of CollectionProcessingEngine


Examples of org.apache.uima.collection.CollectionProcessingEngine

      int exceptionSequence = 4; // the sequence in which errors are produced
      boolean manuallyAborted = false; // flag, if we shut down the cpm by hand.
      ManageOutputDevice.setAllSystemOutputToNirvana();

      // setup CPM
      CollectionProcessingEngine cpe = setupCpm(documentCount,
            "NullPointerException", exceptionSequence, "hasNext");

      // Create and register a Status Callback Listener
      TestStatusCallbackListener listener = new CollectionReaderStatusCallbackListener(
            cpe);
      cpe.addStatusCallbackListener(listener);

      cpe.process();

      // wait until cpm has finished
      Date d = new Date();
      long time = d.getTime() + 1000 * TIMEOUT;
      while (!listener.isFinished() && !listener.isAborted()) {
         Thread.sleep(5);
         d = new Date();
         // timeout mechanism
         if (time < d.getTime()) {
            manuallyAborted = true;
            cpe.stop();
            // wait until CPM has aborted
            while (!listener.isAborted()) {
               Thread.sleep(5);
            }
         }
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.