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 void
cleanup()
Cleanup any jms resources used by the worker threadjavax.jms.BytesMessage
javax.jms.TextMessage
protected String
Returns the full name of the destination queuejavax.jms.MessageProducer
Returns jsm MessageProducerjavax.jms.MessageProducer
getMessageProducer
(javax.jms.Destination destination) protected void
Creates a jms session object used to instantiate message producervoid
setConnection
(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:
getMessageProducer
in interfaceMessageSender
- Overrides:
getMessageProducer
in 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:
setConnection
in interfaceMessageSender
- Specified by:
setConnection
in classBaseMessageSender
-
initializeProducer
Creates a jms session object used to instantiate message producer- Specified by:
initializeProducer
in classBaseMessageSender
- Throws:
Exception
-
getDestinationEndpoint
Returns the full name of the destination queue- Specified by:
getDestinationEndpoint
in classBaseMessageSender
- Throws:
Exception
-
getMessageProducer
public javax.jms.MessageProducer getMessageProducer()Returns jsm MessageProducer- Specified by:
getMessageProducer
in interfaceMessageSender
- Specified by:
getMessageProducer
in classBaseMessageSender
-
createTextMessage
- Throws:
Exception
-
createBytesMessage
- Throws:
Exception
-
cleanup
protected void cleanup()Cleanup any jms resources used by the worker thread- Specified by:
cleanup
in classBaseMessageSender
-