public interface UimaAsynchronousEngine
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 sendAndReceiveCAS(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(CollectionReader) 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(UimaAsBaseCallbackListener) method. These listeners receive
 status callbacks during the processing. An exception to that is the synchronous processing via
 sendAndReceiveCAS(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
 sendAndReceiveCAS(CAS) or sendCAS(CAS) methods from multiple threads.| Modifier and Type | Field and Description | 
|---|---|
| static String | ApplicationContextDeprecated.   | 
| static String | ApplicationNameName of an application that uses Uima AS client. | 
| static String | CasPoolSizeSize of Cas pool to create. | 
| static String | CpcTimeoutCollection Processing Complete timeout. | 
| static String | DD2SpringXsltFilePathPath to the XSLT processor to use when processing a deployment descriptor. | 
| static String | EndpointDeprecated. 
 use ENDPOINT instead | 
| static String | ENDPOINTName of a queue where the Uima AS client sends JMS requests. | 
| static String | GetMetaTimeoutGetMeta timeout. | 
| static String | passwordThe password for Message queuing connection if needed | 
| static String | ReplyWindowDeprecated.   | 
| static String | SaxonClasspathSaxon classpath to use when processing a deployment descriptor. | 
| static String | SERIALIZATION_STRATEGYType of serialization to use when serializing CASes to remote Uima AS service. | 
| static String | SerializationStrategyDeprecated.   | 
| static String | ServerUriBroker URL the Uima AS client will use to communicate with Uima AS service. | 
| static String | ShadowCasPoolSizeDeprecated.   | 
| static String | SharedConnectionDeprecated.   | 
| static String | TargetSelectorProperty | 
| static String | TimeoutCAS process timeout. | 
| static String | TimerPerCASFlag to indicate whether or not the uima-as client should use
 timer per CAS. | 
| static String | UimaEeDebugDebug flag to use when processing a deployment descriptor. | 
| static String | userNameThe userName for Message queuing connection if needed | 
| Modifier and Type | Method and Description | 
|---|---|
| void | addStatusCallbackListener(UimaAsBaseCallbackListener 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 the provided deployment descriptor. | 
| CAS | getCAS()Requests new CAS instance from a CAS pool. | 
| ProcessingResourceMetaData | getMetaData()Returns a  ProcessingResourceMetadatareceived from the UIMA AS Service. | 
| String | getPerformanceReport()Not implemented | 
| SerialFormat | getSerialFormat()Returns serialization strategy for the remote service. | 
| 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(UimaAsBaseCallbackListener aListener)Unregisters named application listener. | 
| String | sendAndReceiveCAS(CAS aCAS)This synchronous method sends a given CAS to a UIMA AS service and waits for response. | 
| String | sendAndReceiveCAS(CAS aCAS,
                 List<AnalysisEnginePerformanceMetrics> componentMetricsList)This synchronous method sends a given CAS to a UIMA AS service and waits for response. | 
| String | sendAndReceiveCAS(CAS aCAS,
                 List<AnalysisEnginePerformanceMetrics> componentMetricsList,
                 String targetServiceId)This synchronous method sends a given CAS to a UIMA AS service and waits for response. | 
| String | sendCAS(CAS aCAS)Sends a given CAS for analysis to UIMA AS Service. | 
| String | sendCAS(CAS aCAS,
       String targetServiceId)Sends a given CAS for analysis to a specific instance of UIMA AS Service. | 
| void | setCollectionReader(CollectionReader aCollectionReader)Registers a  CollectionReaderinstance to process a Collection. | 
| void | stop()Stops the asynchronous client. | 
| void | stopProducingCases()Request Uima AS client to initiate sending Stop requests to a service for all outstanding CASes
 awaiting reply. | 
| void | stopProducingCases(String aCasReferenceId)Request Uima AS client to initiate sending Stop request to a service for a given CAS id If the
 service is a Cas Multiplier, it will stop producing new CASes, will wait until all child CASes
 finish and finally returns the input CAS. | 
| void | undeploy(String aSpringContainerId)Undeploys specified UIMA AS container and all services running within it. | 
| void | undeploy(String aSpringContainerId,
        int stop_level)Undeploys specified UIMA AS container and all services running within it. | 
static final String ApplicationContext
static final String ApplicationName
initialize(Map) .This name is used to register Uima AS 
 client MBean with JMX. To make the name unique, provided string is prepended to a UUID to form 
 ApplicationName_www_xxxx_yyyy_zzzzstatic final String ServerUri
initialize(Map). Required. If omitted, the
 Uima AS client throws ResourceInitializationExceptionstatic final String ENDPOINT
initialize(Map). Required. If omitted, the
 Uima AS client throws ResourceInitializationExceptionstatic final String Endpoint
static final String CasPoolSize
initialize(Map). Optional. 
 If omitted, the Uima AS client will use 1 as a default.static final String ShadowCasPoolSize
static final String ReplyWindow
static final String Timeout
initialize(Map). Optional. If omitted, the
 Uima AS client defaults to no timeout.static final String CpcTimeout
initialize(Map). Optional. If omitted, 
 the Uima AS client defaults to no timeout.static final String GetMetaTimeout
initialize(Map). Optional. If omitted, 
 the Uima AS client defaults to 60 seconds.static final String DD2SpringXsltFilePath
static final String SaxonClasspath
static final String UimaEeDebug
static final String SERIALIZATION_STRATEGY
initialize(Map)static final String SerializationStrategy
static final String userName
static final String password
static final String SharedConnection
static final String TimerPerCAS
static final String TargetSelectorProperty
void initialize(Map anApplicationContext) throws ResourceInitializationException
UimaASStatusCallbackListener.initializationComplete(EntityProcessStatus)
 on the application listener.anApplicationContext - - configuration containing UIMA EE Service Broker URI, service queue name, timeout
          value, reply window size, and CAS Pool size.ResourceInitializationException - init errorvoid setCollectionReader(CollectionReader aCollectionReader) throws ResourceInitializationException
CollectionReader instance to process a Collection. This method must be
 called first, before calling process() method.aCollectionReader - - instance of a CollectionReaderResourceInitializationException - init errorvoid addStatusCallbackListener(UimaAsBaseCallbackListener aListener)
aListener - - application listener object to addvoid removeStatusCallbackListener(UimaAsBaseCallbackListener aListener)
aListener - - application listener to removevoid stop() throws Exception
Exception - errorString getPerformanceReport()
void process()
      throws ResourceProcessException
CollectionReader is provided via
 setCollectionReader(CollectionReader). 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(UimaAsBaseCallbackListener) 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
 UimaASStatusCallbackListener.collectionProcessComplete(EntityProcessStatus aStatus)
ResourceProcessException - - if there is a problem processing the CollectionString sendCAS(CAS aCAS) throws ResourceProcessException
aCAS - - a CAS to analyze.ResourceProcessException - errorString sendCAS(CAS aCAS, String targetServiceId) throws ResourceProcessException
aCAS - - a CAS to analyze.targetServiceId - - Id of a service which should process the CASResourceProcessException - errorCAS getCAS() throws Exception
Exception - errorvoid collectionProcessingComplete()
                           throws ResourceProcessException
ResourceProcessException - errorProcessingResourceMetaData getMetaData() throws 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.ResourceInitializationException - errorString sendAndReceiveCAS(CAS aCAS) throws ResourceProcessException
aCAS - - a CAS to analyze.ResourceProcessException - errorString sendAndReceiveCAS(CAS aCAS, List<AnalysisEnginePerformanceMetrics> componentMetricsList) throws ResourceProcessException
aCAS - - a CAS to analyze.componentMetricsList - - empty list to be filled with per AE performance metricsResourceProcessException - errorString sendAndReceiveCAS(CAS aCAS, List<AnalysisEnginePerformanceMetrics> componentMetricsList, String targetServiceId) throws ResourceProcessException
aCAS - - a CAS to analyze.componentMetricsList - - empty list to be filled with per AE performance metricstargetServiceId - - Id of a specific service which should process the CASResourceProcessException - errorString 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 servicesException - - if there was a problem deploying the container or UIMA AS services.String deploy(String[] aDeploymentDescriptorList, Map anApplicationContext) throws Exception
aDeploymentDescriptorList - - a list of deployment descriptors to deploy in a container.anApplicationContext - - initialization parameters needed to configure the client and servicesException - - 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 - errorvoid undeploy(String aSpringContainerId, int stop_level) throws Exception
aSpringContainerId - - an id of the container to be destroyed.stop_level - stopException - errorSerialFormat getSerialFormat()
void stopProducingCases()
void stopProducingCases(String aCasReferenceId)
aCasReferenceId - cas idCopyright © 2006–2018 The Apache Software Foundation. All rights reserved.