Package org.apache.uima.aae.client

Examples of org.apache.uima.aae.client.UimaAsynchronousEngine


    ae.destroy();
    return cas;
  }

  public CAS analyzeAsynchronously(Reader input, String queueName) throws Exception {
    final UimaAsynchronousEngine uimaAsEngine = new BaseUIMAAsynchronousEngine_impl();
    uimaAsEngine.addStatusCallbackListener(new SimpleUimaAsBaseCallbackListener());
    Map<String, Object> appCtx = new HashMap<String, Object>();
    appCtx.put(UimaAsynchronousEngine.ServerUri, "tcp://localhost:61616");
    appCtx.put(UimaAsynchronousEngine.Endpoint, queueName);
    appCtx.put(UimaAsynchronousEngine.CasPoolSize, 2);
    uimaAsEngine.initialize(appCtx);
    CAS cas = uimaAsEngine.getCAS();
    String text = IOUtils.toString(input);
    cas.setDocumentText(text);
    uimaAsEngine.sendAndReceiveCAS(cas);
    return cas;
  }
View Full Code Here

TOP

Related Classes of org.apache.uima.aae.client.UimaAsynchronousEngine

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.