Class BaseUIMAAsynchronousEngine_impl
java.lang.Object
org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl
org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngine_impl
- All Implemented Interfaces:
javax.jms.MessageListener
,UimaAsynchronousEngine
,ControllerCallbackListener
public class BaseUIMAAsynchronousEngine_impl
extends BaseUIMAAsynchronousEngineCommon_impl
implements UimaAsynchronousEngine, javax.jms.MessageListener, ControllerCallbackListener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl
BaseUIMAAsynchronousEngineCommon_impl.ClientRequest, BaseUIMAAsynchronousEngineCommon_impl.ClientState, BaseUIMAAsynchronousEngineCommon_impl.SharedConnection, BaseUIMAAsynchronousEngineCommon_impl.ThreadMonitor, BaseUIMAAsynchronousEngineCommon_impl.UimaASShutdownHook
-
Field Summary
FieldsFields inherited from class org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl
abort, asynchManager, clientCache, clientSideJmxStats, collectionReader, consumer, cpcReadySemaphore, cpcReplySemaphore, cpcSemaphore, cpcTimeout, CpCTimeout, exc, getMetaSemaphore, idGenerator, initialized, listeners, metadataTimeout, MetadataTimeout, outstandingCasRequests, pendingMessageQueue, PingTimeout, processTimeout, ProcessTimeout, producerInitialized, producerSemaphore, remoteService, resourceMetadata, running, sendAndReceiveCAS, serializationStrategy, serviceDelegate, SHADOW_CAS_POOL, sharedConnection, shutdownHookThread, springContainerRegistry, state, threadMonitorMap, totalCasRequestsSentBetweenCpCs, uniqueIdentifier
Fields inherited from interface org.apache.uima.aae.client.UimaAsynchronousEngine
ApplicationContext, ApplicationName, CasPoolSize, CpcTimeout, DD2SpringXsltFilePath, Endpoint, GetMetaTimeout, ReplyWindow, SaxonClasspath, SerializationStrategy, ServerUri, ShadowCasPoolSize, SharedConnection, Timeout, UimaEeDebug
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
cleanup()
Called at the end of collectionProcessingComplete - WAS closes receiving thread hereprotected javax.jms.BytesMessage
protected void
createSharedConnection
(String aBrokerURI) protected javax.jms.TextMessage
Deploys a single UIMA AS container and all services defined in provided deployment descriptors.First generates a Spring context from a given deploy descriptor and than deploys the context into a Spring Container.protected void
protected String
deploySpringContainer
(String[] springContextFiles) Deploys provided context files ( and beans) in a new Spring container.protected MessageSender
Return a name of the queue to which the JMS Producer is connected to.protected javax.jms.MessageProducer
getMessageProducer
(javax.jms.Destination destination) protected javax.jms.Session
getSession
(String aBrokerURI) protected javax.jms.Session
getSession
(javax.jms.Connection aConnection) void
initialize
(Map anApplicationContext) Initialize the uima ee client.protected void
initializeConsumer
(String aBrokerURI) Create a JMS Consumer on a temporary queue.protected void
initializeConsumer
(String aBrokerURI, javax.jms.Connection connection) protected void
initializeProducer
(String aBrokerURI, String aQueueName) protected void
initializeProducer
(String aBrokerURI, String aQueueName, javax.jms.Connection aConnection) protected javax.jms.MessageProducer
lookupProducerForEndpoint
(Endpoint anEndpoint) static void
void
void
notifyOnInitializationFailure
(AnalysisEngineController aController, Exception e) void
void
notifyOnInitializationSuccess
(AnalysisEngineController aController) void
notifyOnReconnecting
(String aMessage) void
void
notifyOnTermination
(String aServiceName) void
notifyOnTermination
(String aServiceName, String aCasReferenceId, Exception cause) protected void
setCASMessage
(String aCasReferenceId, byte[] aSerializedCAS, javax.jms.Message msg) protected void
setCASMessage
(String aCasReferenceId, String aSerializedCAS, javax.jms.Message msg) protected void
setCASMessage
(String aCasReferenceId, org.apache.uima.cas.CAS aCAS, javax.jms.Message msg) Initialize JMS Message with properties relevant to Process CAS request.protected void
setCommonProperties
(String aCasReferenceId, javax.jms.Message msg, String aSerializationStrategy) void
setCPCMessage
(javax.jms.Message msg) protected void
setMetaRequestMessage
(javax.jms.Message msg) void
setReleaseCASMessage
(javax.jms.TextMessage msg, String aCasReferenceId) void
stop()
Stops the asynchronous client.void
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()
void
Undeploys specified UIMA AS container and all services running within it.void
Undeploys Spring container with a given container Id.protected void
Methods inherited from class org.apache.uima.adapter.jms.client.BaseUIMAAsynchronousEngineCommon_impl
acquireCpcReadySemaphore, addStatusCallbackListener, cancelTimer, collectionProcessingComplete, connectionOpen, decrementOutstandingCasCounter, delayCasIfDelegateInTimedOutState, deserialize, deserialize, deserialize, deserializeCAS, deserializeCAS, deserializeCAS, deserializeCAS, deserializeCAS, deserializeCAS, doStop, getCache, getCAS, getMetaData, getPerformanceReport, getSerializationStrategy, handleCollectionProcessCompleteReply, handleException, handleException, handleException, handleMetadataReply, handleNonProcessException, handleProcessReply, handleServiceInfo, notifyListeners, notifyOnTimout, onBeforeMessageSend, onException, onMessage, onProducerInitialized, process, recoverSharedConnectionIfClosed, removeFromCache, removeStatusCallbackListener, reset, sendAndReceiveCAS, sendAndReceiveCAS, sendCAS, sendMetaRequest, serializeCAS, serializeCAS, setCollectionReader, setSerializationStrategy, waitForCpcReply, waitForMetadataReply, wakeUpSendThread
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface javax.jms.MessageListener
onMessage
Methods inherited from interface org.apache.uima.aae.client.UimaAsynchronousEngine
addStatusCallbackListener, collectionProcessingComplete, getCAS, getMetaData, getPerformanceReport, getSerializationStrategy, process, removeStatusCallbackListener, sendAndReceiveCAS, sendCAS, setCollectionReader
-
Field Details
-
jndiContext
-
Constructor Details
-
BaseUIMAAsynchronousEngine_impl
public BaseUIMAAsynchronousEngine_impl()
-
-
Method Details
-
createTextMessage
protected javax.jms.TextMessage createTextMessage() throws org.apache.uima.resource.ResourceInitializationException- Specified by:
createTextMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
org.apache.uima.resource.ResourceInitializationException
-
createBytesMessage
protected javax.jms.BytesMessage createBytesMessage() throws org.apache.uima.resource.ResourceInitializationException- Specified by:
createBytesMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
org.apache.uima.resource.ResourceInitializationException
-
cleanup
Called at the end of collectionProcessingComplete - WAS closes receiving thread here- Specified by:
cleanup
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
Exception
-
getEndPointName
Return a name of the queue to which the JMS Producer is connected to.- Specified by:
getEndPointName
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
org.apache.uima.resource.ResourceProcessException
-
setMetaRequestMessage
- Specified by:
setMetaRequestMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
Exception
-
setCASMessage
protected void setCASMessage(String aCasReferenceId, org.apache.uima.cas.CAS aCAS, javax.jms.Message msg) throws org.apache.uima.resource.ResourceProcessException Initialize JMS Message with properties relevant to Process CAS request.- Specified by:
setCASMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
org.apache.uima.resource.ResourceProcessException
-
setCASMessage
protected void setCASMessage(String aCasReferenceId, String aSerializedCAS, javax.jms.Message msg) throws org.apache.uima.resource.ResourceProcessException - Specified by:
setCASMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
org.apache.uima.resource.ResourceProcessException
-
setCASMessage
protected void setCASMessage(String aCasReferenceId, byte[] aSerializedCAS, javax.jms.Message msg) throws org.apache.uima.resource.ResourceProcessException - Specified by:
setCASMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
org.apache.uima.resource.ResourceProcessException
-
setCommonProperties
protected void setCommonProperties(String aCasReferenceId, javax.jms.Message msg, String aSerializationStrategy) throws org.apache.uima.resource.ResourceProcessException - Throws:
org.apache.uima.resource.ResourceProcessException
-
stop
public void stop()Description copied from interface:UimaAsynchronousEngine
Stops the asynchronous client. Cleans up resources, drops connection to UIMA AS service queue and stops listening on a response queue.- Specified by:
stop
in interfaceUimaAsynchronousEngine
-
setCPCMessage
- Specified by:
setCPCMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
Exception
-
getSession
- Throws:
Exception
-
getSession
- Throws:
Exception
-
lookupProducerForEndpoint
- Throws:
Exception
-
initializeProducer
- Throws:
Exception
-
initializeProducer
protected void initializeProducer(String aBrokerURI, String aQueueName, javax.jms.Connection aConnection) throws Exception - Throws:
Exception
-
initializeConsumer
Create a JMS Consumer on a temporary queue. Service replies will be handled by this consumer.- Parameters:
aBrokerURI
-- Throws:
Exception
-
initializeConsumer
protected void initializeConsumer(String aBrokerURI, javax.jms.Connection connection) throws Exception - Specified by:
initializeConsumer
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
Exception
-
initialize
public void initialize(Map anApplicationContext) throws org.apache.uima.resource.ResourceInitializationException Initialize the uima ee client. Takes initialization parameters from theanApplicationContext
map.- Specified by:
initialize
in interfaceUimaAsynchronousEngine
- Specified by:
initialize
in classBaseUIMAAsynchronousEngineCommon_impl
- Parameters:
anApplicationContext
- - configuration containing UIMA EE Service Broker URI, service queue name, timeout value, reply window size, and CAS Pool size.- Throws:
org.apache.uima.resource.ResourceInitializationException
-
deploy
First generates a Spring context from a given deploy descriptor and than deploys the context into a Spring Container.- Specified by:
deploy
in interfaceUimaAsynchronousEngine
- Parameters:
aDeploymentDescriptor
- - deployment descriptor to generate Spring Context fromanApplicationContext
- - a Map containing properties required by dd2spring- Returns:
- - a unique spring container id
- Throws:
Exception
- - if there was a problem deploying the container or UIMA AS services.
-
deploy
Description copied from interface:UimaAsynchronousEngine
Deploys a single UIMA AS container and all services defined in provided deployment descriptors. Each deployment descriptor contains an assembly of related UIMA AS services. This method is synchronous and will block until all UIMA AS services are completely deployed and initialized. If there is a problem deploying any of the UIMA AS services the container is destroyed and exception thrown.- Specified by:
deploy
in interfaceUimaAsynchronousEngine
- Specified by:
deploy
in classBaseUIMAAsynchronousEngineCommon_impl
- Parameters:
aDeploymentDescriptorList
- - a list of deployment descriptors to deploy in a container.anApplicationContext
- - initialization parameters needed to configure the client and services- Returns:
- - the id of the container in which the UIMA AS services were deployed
- Throws:
Exception
- - if there was a problem deploying the container or UIMA AS services.
-
undeploy
- Throws:
Exception
-
undeploy
Description copied from interface:UimaAsynchronousEngine
Undeploys specified UIMA AS container and all services running within it. Each UIMA AS container has a unique id assigned to it during the deploy phase. This method is synchronous and will block until the container (and all services contained within it) is destroyed.- Specified by:
undeploy
in interfaceUimaAsynchronousEngine
- Parameters:
aSpringContainerId
- - an id of the container to be destroyed.- Throws:
Exception
-
undeploy
Undeploys Spring container with a given container Id. All deployed Spring containers are registered in the local registry under a unique id.- Specified by:
undeploy
in interfaceUimaAsynchronousEngine
- Parameters:
aSpringContainerId
- - an id of the container to be destroyed.- Throws:
Exception
-
deploySpringContainer
protected String deploySpringContainer(String[] springContextFiles) throws org.apache.uima.resource.ResourceInitializationException Deploys provided context files ( and beans) in a new Spring container.- Specified by:
deploySpringContainer
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
org.apache.uima.resource.ResourceInitializationException
-
waitForServiceNotification
- Throws:
Exception
-
deployEmbeddedBroker
- Throws:
Exception
-
main
-
setReleaseCASMessage
public void setReleaseCASMessage(javax.jms.TextMessage msg, String aCasReferenceId) throws Exception - Overrides:
setReleaseCASMessage
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
Exception
-
notifyOnInitializationFailure
- Specified by:
notifyOnInitializationFailure
in interfaceControllerCallbackListener
-
notifyOnInitializationSuccess
public void notifyOnInitializationSuccess()- Specified by:
notifyOnInitializationSuccess
in interfaceControllerCallbackListener
-
notifyOnInitializationFailure
- Specified by:
notifyOnInitializationFailure
in interfaceControllerCallbackListener
-
notifyOnInitializationSuccess
- Specified by:
notifyOnInitializationSuccess
in interfaceControllerCallbackListener
-
notifyOnTermination
- Specified by:
notifyOnTermination
in interfaceControllerCallbackListener
-
notifyOnTermination
-
getMessageProducer
protected javax.jms.MessageProducer getMessageProducer(javax.jms.Destination destination) throws Exception - Overrides:
getMessageProducer
in classBaseUIMAAsynchronousEngineCommon_impl
- Throws:
Exception
-
stopProducingCases
public void stopProducingCases()Request Uima AS client to initiate sending Stop requests to a service for all outstanding CASes awaiting reply.- Specified by:
stopProducingCases
in interfaceUimaAsynchronousEngine
-
stopProducingCases
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.- Specified by:
stopProducingCases
in interfaceUimaAsynchronousEngine
-
getDispatcher
- Specified by:
getDispatcher
in classBaseUIMAAsynchronousEngineCommon_impl
-
notifyOnReconnecting
- Specified by:
notifyOnReconnecting
in interfaceControllerCallbackListener
-
notifyOnReconnectionSuccess
public void notifyOnReconnectionSuccess()- Specified by:
notifyOnReconnectionSuccess
in interfaceControllerCallbackListener
-