|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface UimaAsynchronousEngine
A 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 #sendAndReceive(CAS)
method. For asynchronous
processing the application should call sendCAS(CAS)
method. Additionally, processing
with a client side CollectionReader
is supported as well. The application first
instantiates and initializes the CollectionReader
and registers it via
#setCollectionReader(CollectionReads)
method. Once the CollectionReader
is registered, and initialize(Map)
method is called, the application may call
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
deploy(String, Map)
deploy(String[], Map)
method, where the first parameter is either a single AS deployment descriptor or an
array thereof. The application must deploy its "private" services *before* calling
initialize(Map)
method.
The application may stop the UIMA AS client in the middle of processing by calling
stop()
method.
Listeners can register with the UimaAsynchronousEngine
by calling the
addStatusCallbackListener(UimaASStatusCallbackListener)
method. These listeners receive status
callbacks during the processing. An exception to that is the synchronous processing via
#sendAndReceive(CAS)
method. This method returns either a CAS containing results of
analysis or an exception. No callbacks are made while processing CASes synchronously.
An application may choose to implement parallelization of the processing, calling either
#sendAndReceive(CAS)
or #sendCASCAS)
methods from multiple threads.
Field Summary | |
---|---|
static String |
ApplicationContext
|
static String |
ApplicationName
|
static String |
CasPoolSize
|
static String |
CpcTimeout
|
static String |
DD2SpringXsltFilePath
|
static String |
Endpoint
|
static String |
GetMetaTimeout
|
static String |
ReplyWindow
|
static String |
SaxonClasspath
|
static String |
ServerUri
|
static String |
Timeout
|
static String |
UimaEeDebug
|
Method Summary | |
---|---|
void |
addStatusCallbackListener(UimaASStatusCallbackListener aListener)
Registers application specific listener. |
void |
collectionProcessingComplete()
Sends a Collection Processing Complete (CPC) request to a UIMA AS Service and blocks waiting for a reply. |
String |
deploy(String[] aDeploymentDescriptorList,
Map anApplicationContext)
Deploys a single UIMA AS container and all services defined in provided deployment descriptors. |
String |
deploy(String aDeploymentDescriptor,
Map anApplicationContext)
Deploys a UIMA AS container and all services defined in provided deployment descriptor. |
org.apache.uima.cas.CAS |
getCAS()
Requests new CAS instance from a CAS pool. |
org.apache.uima.resource.metadata.ProcessingResourceMetaData |
getMetaData()
Returns a ProcessingResourceMetadata received from the UIMA AS Service. |
String |
getPerformanceReport()
Not implemented |
void |
initialize(Map anApplicationContext)
Initializes UIMA asynchronous client using configuration parameters provided in a Map object. |
void |
process()
Initiates processing of a collection. |
void |
removeStatusCallbackListener(UimaASStatusCallbackListener aListener)
Unregisters named application listener. |
void |
sendAndReceiveCAS(org.apache.uima.cas.CAS aCAS)
This synchronous method sends a given CAS to a UIMA AS service and waits for response. |
String |
sendCAS(org.apache.uima.cas.CAS aCAS)
Sends a given CAS for analysis to UIMA AS Service. |
void |
setCollectionReader(org.apache.uima.collection.CollectionReader aCollectionReader)
Registers a CollectionReader instance to process a Collection. |
void |
stop()
Stops the asynchronous client. |
void |
undeploy(String aSpringContainerId)
Undeploys specified UIMA AS container and all services running within it. |
Field Detail |
---|
static final String ApplicationContext
static final String ApplicationName
static final String ServerUri
static final String Endpoint
static final String CasPoolSize
static final String ReplyWindow
static final String Timeout
static final String CpcTimeout
static final String GetMetaTimeout
static final String DD2SpringXsltFilePath
static final String SaxonClasspath
static final String UimaEeDebug
Method Detail |
---|
void initialize(Map anApplicationContext) throws org.apache.uima.resource.ResourceInitializationException
#initializationComplete()
on the application listener.
anApplicationContext
- - configuration containing UIMA EE Service Broker URI, service
queue name, timeout value, reply window size, and CAS Pool size.
org.apache.uima.resource.ResourceInitializationException
void setCollectionReader(org.apache.uima.collection.CollectionReader aCollectionReader) throws org.apache.uima.resource.ResourceInitializationException
CollectionReader
instance to process a Collection. This method must be called first, before
calling process()
method.
aCollectionReader
- - instance of a CollectionReader
org.apache.uima.resource.ResourceInitializationException
void addStatusCallbackListener(UimaASStatusCallbackListener aListener)
aListener
- - application listener object to addvoid removeStatusCallbackListener(UimaASStatusCallbackListener aListener)
aListener
- - application listener to removevoid stop() throws Exception
Exception
String getPerformanceReport()
void process() throws org.apache.uima.resource.ResourceProcessException
CollectionReader
is provided via #setCollectionReader()
.
This method blocks until the CollectionReader
finishes processing the entire collection.
Status of the processing can be obtained by registering a listener with
the addStatusCallbackListener(UimaASStatusCallbackListener)
method.
The method is synchronized to allow processing of only one collection at a time. The application must
wait with processing another collection until it receives notification via a listener
#org.apache.uima.aae.clientcollectionProcessComplete(EntityProcessStatus aStatus)
org.apache.uima.resource.ResourceProcessException
- - if there is a problem processing the CollectionString sendCAS(org.apache.uima.cas.CAS aCAS) throws org.apache.uima.resource.ResourceProcessException
aCAS
- - a CAS to analyze.
org.apache.uima.resource.ResourceProcessException
org.apache.uima.cas.CAS getCAS() throws Exception
Exception
void collectionProcessingComplete() throws org.apache.uima.resource.ResourceProcessException
org.apache.uima.resource.ResourceProcessException
org.apache.uima.resource.metadata.ProcessingResourceMetaData getMetaData() throws org.apache.uima.resource.ResourceInitializationException
ProcessingResourceMetadata
received from the UIMA AS Service.
The metadata is obtained from the service during initialization.
returns - an ProcessingResourceMetadata received from an asynchronous
Analysis Engine service, or null if initialize() has not yet been called.
org.apache.uima.resource.ResourceInitializationException
void sendAndReceiveCAS(org.apache.uima.cas.CAS aCAS) throws org.apache.uima.resource.ResourceProcessException
aCAS
- - a CAS to analyze.
org.apache.uima.resource.ResourceProcessException
String deploy(String aDeploymentDescriptor, Map anApplicationContext) throws Exception
aDeploymentDescriptor-
- a deployment descriptor to deploy in a container.anApplicationContext
- - initialization parameters needed to configure the
client and services
Exception
- - if there was a problem deploying the container or UIMA AS services.String deploy(String[] aDeploymentDescriptorList, Map anApplicationContext) throws Exception
aDeploymentDescriptor-
- a deployment descriptor to deploy in a container.anApplicationContext
- - initialization parameters needed to configure the
client and services
Exception
- - if there was a problem deploying the container or UIMA AS services.void undeploy(String aSpringContainerId) throws Exception
aSpringContainerId
- - an id of the container to be destroyed.
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |