UimaAsynchronousEngine
enables an application to send CASes for analysis to remote UIMA AS service. It provides a high level API and hides the detail of the transport implementation. The UIMA AS Client implementation uses JMS as its transport mechanism. Both synchronous and asynchronous processing is supported. For synchronous processing an application should call {@link #sendAndReceiveCAS(CAS)} method. For asynchronous processing the applicationshould call {@link #sendCAS(CAS)} method. Additionally, processing with a client sideCollectionReader
is supported as well. The application first instantiates and initializes the CollectionReader
and registers it via {@link #setCollectionReader(CollectionReader)} method. Once the CollectionReader
isregistered, and {@link #initialize(Map)} method is called, the application may call{@link #process()} method.This API enables the application to dynamically deploy UIMA AS services that it intends to use for processing. These services are deployed in a container and are collocated in the same JVM as the application. The services are considered private and used exclusively by the application. To deploy "private" services the application calls either {@link #deploy(String,Map)}{@link #deploy(String[],Map)} method, where the first parameter is either a single AS deploymentdescriptor or an array thereof. The application must deploy its "private" services *before calling {@link #initialize(Map)} method.
The application may stop the UIMA AS client in the middle of processing by calling {@link #stop()} method.
Listeners can register with the UimaAsynchronousEngine
by calling the {@link #addStatusCallbackListener(UimaAsBaseCallbackListener)} method. These listeners receivestatus callbacks during the processing. An exception to that is the synchronous processing via {@link #sendAndReceiveCAS(CAS)} method. This method returns either a CAS containing results ofanalysis or an exception. No callbacks are made while processing CASes synchronously.
An application may choose to implement parallelization of the processing, calling either {@link #sendAndReceiveCAS(CAS)} or {@link #sendCAS(CAS)} methods from multiple threads.
|
|