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