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 boolean
attachToBrokerMBeanServer
-
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 void
abort()
void
ackMessage(MessageContext aMessageContext)
void
createListener(java.lang.String aDelegateKey, Endpoint endpointToUpdate)
void
destroyListener(java.lang.String anEndpointName, java.lang.String aDelegateKey)
java.lang.String
getBrokerURL()
int
getConcurrentConsumerCount()
org.apache.activemq.ActiveMQConnectionFactory
getConnectionFactory()
AnalysisEngineController
getController()
java.lang.String
getInputQueueName()
java.lang.String
getName()
java.lang.String
getServerUri()
ServiceInfo
getServiceInfo()
int
getSessionAckMode()
boolean
isFailed(java.lang.String aDelegateKey)
boolean
isListenerActiveOnDestination(javax.jms.Destination destination)
boolean
isListenerForDestination(java.lang.String anEndpointName)
boolean
isStopped()
void
onMessage(javax.jms.Message aMessage, javax.jms.Session aJmsSession)
Receives Messages from the JMS Provider.void
removeDelegateFromFailedList(java.lang.String aDelegateKey)
void
setController(AnalysisEngineController aController)
void
setEndpointName(java.lang.String anEndpointName)
void
setListenerContainer(UimaDefaultMessageListenerContainer messageListener)
void
setMessageHandler(Handler aHandler)
void
setServerUri(java.lang.String serverUri)
void
setTerminating()
void
stop()
void
stop(int channelsToClose)
void
terminate()
boolean
validMessage(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.Exception
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:
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:
onMessage
in interfaceorg.springframework.jms.listener.SessionAwareMessageListener
- Parameters:
aMessage
- - JMS Message containing header and payloadaJmsSession
- - JMSSession object
-
getSessionAckMode
public int getSessionAckMode()
- Specified by:
getSessionAckMode
in interfaceInputChannel
-
getServerUri
public java.lang.String getServerUri()
- Specified by:
getServerUri
in interfaceInputChannel
-
setListenerContainer
public void setListenerContainer(UimaDefaultMessageListenerContainer messageListener)
-
getConnectionFactory
public org.apache.activemq.ActiveMQConnectionFactory getConnectionFactory()
-
ackMessage
public void ackMessage(MessageContext aMessageContext)
- Specified by:
ackMessage
in interfaceInputChannel
-
getBrokerURL
public java.lang.String getBrokerURL()
- Specified by:
getBrokerURL
in interfaceJmsInputChannelMBean
-
getInputQueueName
public java.lang.String getInputQueueName()
- Specified by:
getInputQueueName
in interfaceInputChannel
- Specified by:
getInputQueueName
in interfaceJmsInputChannelMBean
-
getServiceInfo
public ServiceInfo getServiceInfo()
- Specified by:
getServiceInfo
in interfaceInputChannel
-
setServerUri
public void setServerUri(java.lang.String serverUri)
- Specified by:
setServerUri
in interfaceInputChannel
-
stop
public void stop() throws java.lang.Exception
-
setTerminating
public void setTerminating()
- Specified by:
setTerminating
in interfaceInputChannel
-
terminate
public void terminate()
- Specified by:
terminate
in interfaceInputChannel
-
stop
public void stop(int channelsToClose) throws java.lang.Exception
-
isStopped
public boolean isStopped()
- Specified by:
isStopped
in interfaceInputChannel
-
getConcurrentConsumerCount
public int getConcurrentConsumerCount()
- Specified by:
getConcurrentConsumerCount
in interfaceInputChannel
-
createListener
public void createListener(java.lang.String aDelegateKey, Endpoint endpointToUpdate) throws java.lang.Exception
- Specified by:
createListener
in 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:
destroyListener
in interfaceInputChannel
-
isFailed
public boolean isFailed(java.lang.String aDelegateKey)
- Specified by:
isFailed
in interfaceInputChannel
-
removeDelegateFromFailedList
public void removeDelegateFromFailedList(java.lang.String aDelegateKey)
- Specified by:
removeDelegateFromFailedList
in interfaceInputChannel
-
isListenerForDestination
public boolean isListenerForDestination(java.lang.String anEndpointName)
- Specified by:
isListenerForDestination
in interfaceInputChannel
-
-