Class JmsInputChannel
java.lang.Object
org.apache.uima.adapter.jms.activemq.JmsInputChannel
- All Implemented Interfaces:
Serializable,Channel,InputChannel,JmsInputChannelMBean,org.springframework.jms.listener.SessionAwareMessageListener
public class JmsInputChannel
extends Object
implements InputChannel, JmsInputChannelMBean, org.springframework.jms.listener.SessionAwareMessageListener
Thin adapter for receiving JMS messages from Spring. It delegates processing of all messages to
the
Handler. Each JMS Message is wrapped in transport neutral MessageContext
wrapper.- See Also:
-
Field Summary
FieldsFields inherited from interface org.apache.uima.aae.Channel
CloseAllChannels, InputChannels -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidackMessage(MessageContext aMessageContext) voidcreateListener(String aDelegateKey, Endpoint endpointToUpdate) voiddestroyListener(String anEndpointName, String aDelegateKey) intorg.apache.activemq.ActiveMQConnectionFactorygetName()intbooleanbooleanisListenerActiveOnDestination(javax.jms.Destination destination) booleanisListenerForDestination(String anEndpointName) booleanvoidonMessage(javax.jms.Message aMessage, javax.jms.Session aJmsSession) Receives Messages from the JMS Provider.voidremoveDelegateFromFailedList(String aDelegateKey) voidsetController(AnalysisEngineController aController) voidsetEndpointName(String anEndpointName) voidsetListenerContainer(UimaDefaultMessageListenerContainer messageListener) voidsetMessageHandler(Handler aHandler) voidsetServerUri(String serverUri) voidvoidstop()voidstop(int channelsToClose) voidbooleanvalidMessage(javax.jms.Message aMessage) Validates contents of the message.
-
Field Details
-
attachToBrokerMBeanServer
public static transient boolean attachToBrokerMBeanServer
-
-
Constructor Details
-
JmsInputChannel
public JmsInputChannel()
-
-
Method Details
-
getController
-
getName
-
setController
- Throws:
Exception
-
setMessageHandler
-
setEndpointName
-
validMessage
Validates contents of the message. It checks if command, payload and message types contain valid data.- Parameters:
aMessage- - JMS Message to validate- Returns:
- - true if message is valid, false otherwise
- Throws:
Exception
-
abort
public void abort() -
onMessage
public void onMessage(javax.jms.Message aMessage, javax.jms.Session aJmsSession) Receives Messages from the JMS Provider. It checks the message header to determine the type of message received. Based on the type, a MessageContext is created to facilitate access to the transport specific message. Once the MessageContext is determined this routine delegates handling of the message to the chain of MessageHandlers.- Specified by:
onMessagein interfaceorg.springframework.jms.listener.SessionAwareMessageListener- Parameters:
aMessage- - JMS Message containing header and payloadaJmsSession- - JMSSession object
-
getSessionAckMode
public int getSessionAckMode()- Specified by:
getSessionAckModein interfaceInputChannel
-
getServerUri
- Specified by:
getServerUriin interfaceInputChannel
-
setListenerContainer
-
getConnectionFactory
public org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory() -
ackMessage
- Specified by:
ackMessagein interfaceInputChannel
-
getBrokerURL
- Specified by:
getBrokerURLin interfaceJmsInputChannelMBean
-
getInputQueueName
- Specified by:
getInputQueueNamein interfaceInputChannel- Specified by:
getInputQueueNamein interfaceJmsInputChannelMBean
-
getServiceInfo
- Specified by:
getServiceInfoin interfaceInputChannel
-
setServerUri
- Specified by:
setServerUriin interfaceInputChannel
-
stop
-
setTerminating
public void setTerminating()- Specified by:
setTerminatingin interfaceInputChannel
-
terminate
public void terminate()- Specified by:
terminatein interfaceInputChannel
-
stop
-
isStopped
public boolean isStopped()- Specified by:
isStoppedin interfaceInputChannel
-
getConcurrentConsumerCount
public int getConcurrentConsumerCount()- Specified by:
getConcurrentConsumerCountin interfaceInputChannel
-
createListener
- Specified by:
createListenerin interfaceInputChannel- Throws:
Exception
-
isListenerActiveOnDestination
public boolean isListenerActiveOnDestination(javax.jms.Destination destination) -
destroyListener
- Specified by:
destroyListenerin interfaceInputChannel
-
isFailed
- Specified by:
isFailedin interfaceInputChannel
-
removeDelegateFromFailedList
- Specified by:
removeDelegateFromFailedListin interfaceInputChannel
-
isListenerForDestination
- Specified by:
isListenerForDestinationin interfaceInputChannel
-