Class ActiveMQMessageSender
java.lang.Object
org.apache.uima.adapter.jms.client.BaseMessageSender
org.apache.uima.adapter.jms.client.ActiveMQMessageSender
- All Implemented Interfaces:
Runnable,MessageSender
Initializes JMS session and creates JMS MessageProducer to be used for sending messages to a
given destination. It extends BaseMessageSender which starts the worker thread and is tasked with
sending messages. The application threads share a common 'queue' with the worker thread. The
application threads add messages to the pendingMessageList 'queue' and the worker thread consumes
them.
-
Field Summary
Fields inherited from class org.apache.uima.adapter.jms.client.BaseMessageSender
done, engine, exception, messageQueue, workerThreadFailed -
Constructor Summary
ConstructorsConstructorDescriptionActiveMQMessageSender(javax.jms.Connection aConnection, String aDestinationName, BaseUIMAAsynchronousEngineCommon_impl engine) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcleanup()Cleanup any jms resources used by the worker threadjavax.jms.BytesMessagejavax.jms.TextMessageprotected StringReturns the full name of the destination queuejavax.jms.MessageProducerReturns jsm MessageProducerjavax.jms.MessageProducergetMessageProducer(javax.jms.Destination destination) protected voidCreates a jms session object used to instantiate message producervoidsetConnection(javax.jms.Connection aConnection) This is called when a new Connection is created after broker is restartedMethods inherited from class org.apache.uima.adapter.jms.client.BaseMessageSender
doStop, failed, getReasonForFailure, run
-
Constructor Details
-
ActiveMQMessageSender
public ActiveMQMessageSender(javax.jms.Connection aConnection, String aDestinationName, BaseUIMAAsynchronousEngineCommon_impl engine) throws Exception - Throws:
Exception
-
-
Method Details
-
getMessageProducer
public javax.jms.MessageProducer getMessageProducer(javax.jms.Destination destination) throws Exception - Specified by:
getMessageProducerin interfaceMessageSender- Overrides:
getMessageProducerin classBaseMessageSender- Throws:
Exception
-
setConnection
public void setConnection(javax.jms.Connection aConnection) This is called when a new Connection is created after broker is restarted- Specified by:
setConnectionin interfaceMessageSender- Specified by:
setConnectionin classBaseMessageSender
-
initializeProducer
Creates a jms session object used to instantiate message producer- Specified by:
initializeProducerin classBaseMessageSender- Throws:
Exception
-
getDestinationEndpoint
Returns the full name of the destination queue- Specified by:
getDestinationEndpointin classBaseMessageSender- Throws:
Exception
-
getMessageProducer
public javax.jms.MessageProducer getMessageProducer()Returns jsm MessageProducer- Specified by:
getMessageProducerin interfaceMessageSender- Specified by:
getMessageProducerin classBaseMessageSender
-
createTextMessage
- Throws:
Exception
-
createBytesMessage
- Throws:
Exception
-
cleanup
protected void cleanup()Cleanup any jms resources used by the worker thread- Specified by:
cleanupin classBaseMessageSender
-