Class JmsInputChannel
- java.lang.Object
-
- org.apache.uima.adapter.jms.activemq.JmsInputChannel
-
- All Implemented Interfaces:
java.io.Serializable,Channel,InputChannel,JmsInputChannelMBean,org.springframework.jms.listener.SessionAwareMessageListener
public class JmsInputChannel extends java.lang.Object implements InputChannel, JmsInputChannelMBean, org.springframework.jms.listener.SessionAwareMessageListener
Thin adapter for receiving JMS messages from Spring. It delegates processing of all messages to theHandler. Each JMS Message is wrapped in transport neutral MessageContext wrapper.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static booleanattachToBrokerMBeanServer-
Fields inherited from interface org.apache.uima.aae.Channel
CloseAllChannels, InputChannels
-
-
Constructor Summary
Constructors Constructor Description JmsInputChannel()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidabort()voidackMessage(MessageContext aMessageContext)voidcreateListener(java.lang.String aDelegateKey, Endpoint endpointToUpdate)voiddestroyListener(java.lang.String anEndpointName, java.lang.String aDelegateKey)java.lang.StringgetBrokerURL()intgetConcurrentConsumerCount()org.apache.activemq.ActiveMQConnectionFactorygetConnectionFactory()AnalysisEngineControllergetController()java.lang.StringgetInputQueueName()java.lang.StringgetName()java.lang.StringgetServerUri()ServiceInfogetServiceInfo()intgetSessionAckMode()booleanisFailed(java.lang.String aDelegateKey)booleanisListenerActiveOnDestination(javax.jms.Destination destination)booleanisListenerForDestination(java.lang.String anEndpointName)booleanisStopped()voidonMessage(javax.jms.Message aMessage, javax.jms.Session aJmsSession)Receives Messages from the JMS Provider.voidremoveDelegateFromFailedList(java.lang.String aDelegateKey)voidsetController(AnalysisEngineController aController)voidsetEndpointName(java.lang.String anEndpointName)voidsetListenerContainer(UimaDefaultMessageListenerContainer messageListener)voidsetMessageHandler(Handler aHandler)voidsetServerUri(java.lang.String serverUri)voidsetTerminating()voidstop()voidstop(int channelsToClose)voidterminate()booleanvalidMessage(javax.jms.Message aMessage)Validates contents of the message.
-
-
-
Method Detail
-
getController
public AnalysisEngineController getController()
-
setController
public void setController(AnalysisEngineController aController) throws java.lang.Exception
- Throws:
java.lang.Exception
-
setMessageHandler
public void setMessageHandler(Handler aHandler)
-
setEndpointName
public void setEndpointName(java.lang.String anEndpointName)
-
validMessage
public boolean validMessage(javax.jms.Message aMessage) throws java.lang.ExceptionValidates 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:
java.lang.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
public java.lang.String getServerUri()
- Specified by:
getServerUriin interfaceInputChannel
-
setListenerContainer
public void setListenerContainer(UimaDefaultMessageListenerContainer messageListener)
-
getConnectionFactory
public org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory()
-
ackMessage
public void ackMessage(MessageContext aMessageContext)
- Specified by:
ackMessagein interfaceInputChannel
-
getBrokerURL
public java.lang.String getBrokerURL()
- Specified by:
getBrokerURLin interfaceJmsInputChannelMBean
-
getInputQueueName
public java.lang.String getInputQueueName()
- Specified by:
getInputQueueNamein interfaceInputChannel- Specified by:
getInputQueueNamein interfaceJmsInputChannelMBean
-
getServiceInfo
public ServiceInfo getServiceInfo()
- Specified by:
getServiceInfoin interfaceInputChannel
-
setServerUri
public void setServerUri(java.lang.String serverUri)
- Specified by:
setServerUriin interfaceInputChannel
-
stop
public void stop() throws java.lang.Exception
-
setTerminating
public void setTerminating()
- Specified by:
setTerminatingin interfaceInputChannel
-
terminate
public void terminate()
- Specified by:
terminatein interfaceInputChannel
-
stop
public void stop(int channelsToClose) throws java.lang.Exception
-
isStopped
public boolean isStopped()
- Specified by:
isStoppedin interfaceInputChannel
-
getConcurrentConsumerCount
public int getConcurrentConsumerCount()
- Specified by:
getConcurrentConsumerCountin interfaceInputChannel
-
createListener
public void createListener(java.lang.String aDelegateKey, Endpoint endpointToUpdate) throws java.lang.Exception- Specified by:
createListenerin interfaceInputChannel- Throws:
java.lang.Exception
-
isListenerActiveOnDestination
public boolean isListenerActiveOnDestination(javax.jms.Destination destination)
-
destroyListener
public void destroyListener(java.lang.String anEndpointName, java.lang.String aDelegateKey)- Specified by:
destroyListenerin interfaceInputChannel
-
isFailed
public boolean isFailed(java.lang.String aDelegateKey)
- Specified by:
isFailedin interfaceInputChannel
-
removeDelegateFromFailedList
public void removeDelegateFromFailedList(java.lang.String aDelegateKey)
- Specified by:
removeDelegateFromFailedListin interfaceInputChannel
-
isListenerForDestination
public boolean isListenerForDestination(java.lang.String anEndpointName)
- Specified by:
isListenerForDestinationin interfaceInputChannel
-
-