Examples of BaseUIMAAsynchronousEngine_impl


Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

  }
  public void testClientHttpTunnelling() throws Exception {
    System.out.println("-------------- testClientHttpTunnelling -------------");
    String httpURI = getHttpURI();
    // Create Uima EE Client
    BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    // Deploy remote service
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
    // Initialize and run the Test. Wait for a completion and cleanup resources.
    System.out.println("-------- Connecting Client To Service: "+httpURI);
    runTest(null, eeUimaEngine, httpURI, "NoOpAnnotatorQueue", 1, PROCESS_LATCH);
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

                .println(" ***   apache-uima-as/uima-as/src/main/apache-activemq-X.y.z directory");
        System.out.println(" ***   in the apache-uima-as source distribution.");

        String httpURI = getHttpURI();
      // Create Uima EE Client
        BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
        // Deploy remote service
        deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");

        InputStream fis = new FileInputStream(file);
        Reader rd = new InputStreamReader(fis, "UTF-8");
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

   * @throws Exception
   */
  public void testBrokerFailoverSupportUsingHTTP() throws Exception  {
    System.out.println("-------------- testBrokerFailoverSupportUsingTCP -------------");
     // Instantiate Uima AS Client
      BaseUIMAAsynchronousEngine_impl uimaAsEngine = new BaseUIMAAsynchronousEngine_impl();
      BrokerService broker2 = setupSecondaryBroker(false);

      String bhttpURL = addHttpConnector(broker2, DEFAULT_HTTP_PORT2);
      String burl = "failover:("+bhttpURL+","+broker2.getConnectorByName(DEFAULT_BROKER_URL_KEY_2).getUri().toString().replaceAll("tcp","http")+")?randomize=false";
      System.setProperty("BrokerURL", burl);
      // Deploy Uima AS Primitive Service
      deployService(uimaAsEngine, relativePath + "/Deploy_NoOpAnnotatorWithPlaceholder.xml");
      Map<String, Object> appCtx = buildContext(burl,"NoOpAnnotatorQueue");
      appCtx.put(UimaAsynchronousEngine.Timeout, 1100);
      appCtx.put(UimaAsynchronousEngine.CpcTimeout, 1100);
      initialize(uimaAsEngine, appCtx);
      waitUntilInitialized();
      int errorCount = 0;
      for (int i = 0; i < 15; i++) {
        CAS cas = uimaAsEngine.getCAS();
        cas.setDocumentText("Some Text");
        System.out.println("UIMA AS Client Sending CAS#" + (i + 1) + " Request to a Service");
        try {
          uimaAsEngine.sendAndReceiveCAS(cas);
        } catch( Exception e) {
          errorCount++;
        } finally {
          cas.release();
        }
      }
      uimaAsEngine.stop();
      super.cleanBroker(broker2);
      broker2.stop();
      synchronized(this) {
        wait(3000);   // allow broker some time to stop 
      }
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

          int howManyCASesPerRunningThread, int howManyRunningThreads, int timeout,
          int aGetMetaTimeout, boolean failOnTimeout ) throws Exception {
    // Instantiate Uima EE Client
    isStopped = false;
    isStopping = false;
    final BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    // Deploy Uima EE Primitive Service
    final String containerId = deployService(eeUimaEngine, serviceDeplyDescriptor);

    engine = eeUimaEngine;

    Thread t1 = null;
    Thread t2 = null;
    Map appCtx = buildContext(String.valueOf(broker.getMasterConnectorURI()), queueName, timeout);
    // Set an explicit getMeta (Ping)timeout
    appCtx.put(UimaAsynchronousEngine.GetMetaTimeout, aGetMetaTimeout);
    appCtx.put(UimaAsynchronousEngine.Timeout, 1000);

    initialize(eeUimaEngine, appCtx);

    // Wait until the top level service returns its metadata
    waitUntilInitialized();
    final Semaphore ctrlSemaphore = new Semaphore(1);
    t2 = spinMonitorThread(ctrlSemaphore, howManyCASesPerRunningThread * howManyRunningThreads,
            PROCESS_LATCH);
    // Wait until the CPC Thread is ready.
    waitOnMonitor(ctrlSemaphore);

    if (failOnTimeout) {
      // Spin a thread and wait for awhile before killing the remote service.
      // This will cause the client to timeout waiting for a CAS reply and
      // to send a Ping message to test service availability. The Ping times
      // out and causes the client API to stop.
      new Thread("WaitThenUndeploy") {
        public void run() {
          Object mux = new Object();
          synchronized (mux) {
            try {
              mux.wait(5000);
              // Undeploy service container
              eeUimaEngine.undeploy(containerId);
            } catch (Exception e) {
            }
          }
        }
      }.start();

    }

    // Spin runner threads and start sending CASes
    for (int i = 0; i < howManyRunningThreads; i++) {
      SynchRunner runner = new SynchRunner(eeUimaEngine, howManyCASesPerRunningThread, listener);
      Thread runnerThread = new Thread(runner, "Runner" + i);
      runnerThread.start();
      System.out.println("runTest: Started Runner Thread::Id=" + runnerThread.getId());

    }
    // Wait until ALL CASes return from the service
    t2.join();
    t1 = spinMonitorThread(ctrlSemaphore, 1, CPC_LATCH);

    if (!isStopped && !unexpectedException) {
      System.out.println("runTest: Sending CPC");
      // Send CPC
      eeUimaEngine.collectionProcessingComplete();
    }

    // If have skipped CPC trip the latch
    if (unexpectedException && cpcLatch != null) {
      cpcLatch.countDown();
    }
    t1.join();
    isStopping = true;
    eeUimaEngine.stop();
  }
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

            1, PROCESS_LATCH);
  }

  public void testBlueJDeployment() throws Exception {
    System.out.println("-------------- testBlueJDeployment -------------");
    BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    // Deploy replicated services for the inner remote aggregate CM
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

            "TopLevelTaeQueue", 10, PROCESS_LATCH);
  }

  public void testTypesystemMergeWithMultiplier() throws Exception {
    System.out.println("-------------- testTypesystemMergeWithMultiplier -------------");
    BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    deployService(eeUimaEngine, relativePath + "/Deploy_AggregateWithMergedTypes.xml");
    runTest(null, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()), "TopLevelTaeQueue",
            1, PROCESS_LATCH);
  }
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

  public void testStopAggregateWithRemoteMultiplier() throws Exception {
    System.out.println("-------------- testStopAggregateWithRemoteMultiplier -------------");
   
    System.setProperty("BrokerURL", broker.getMasterConnectorURI());
    BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    deployService(eeUimaEngine, relativePath + "/Deploy_RemoteCasMultiplier.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotatorWithExceptionOn5thCAS.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_AggregateWithRemoteMultiplier.xml");
    runTest(null, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()), "TopLevelTaeQueue",
            1, EXCEPTION_LATCH);
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

  }

  public void testCancelProcessAggregateWithCollocatedMultiplier() throws Exception {
    System.out
            .println("-------------- testCancelProcessAggregateWithCollocatedMultiplier -------------");
    BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_ComplexAggregateWith1MillionDocs.xml");
    // Spin a thread to cancel Process after 20 seconds
    spinShutdownThread(eeUimaEngine, 20000);
    runTest(null, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()), "TopLevelTaeQueue",
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

  }

  public void testCancelProcessAggregateWithRemoteMultiplier() throws Exception {
    System.out.println("-------------- testStopAggregateWithRemoteMultiplier -------------");
    System.setProperty("BrokerURL", broker.getMasterConnectorURI());
    BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    deployService(eeUimaEngine, relativePath + "/Deploy_RemoteCasMultiplierWith1MillionDocs.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotator.xml");
    deployService(eeUimaEngine, relativePath + "/Deploy_AggregateWithRemoteMultiplier.xml");
    // Spin a thread to cancel Process after 20 seconds
    spinShutdownThread(eeUimaEngine, 20000);
View Full Code Here

Examples of org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl

   * @throws Exception
   */
  public void testPrimitiveServiceResponseOnException() throws Exception {
    System.out.println("-------------- testPrimitiveServiceResponseOnException -------------");
    // Instantiate Uima EE Client
    BaseUIMAAsynchronousEngine_impl eeUimaEngine = new BaseUIMAAsynchronousEngine_impl();
    // Deploy remote service
    deployService(eeUimaEngine, relativePath + "/Deploy_NoOpAnnotatorWithException.xml");
    // Deploy Uima EE Primitive Service
    // Initialize and run the Test. Wait for a completion and cleanup resources.
    runTest(null, eeUimaEngine, String.valueOf(broker.getMasterConnectorURI()),
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.