Class JmsConsumer
- java.lang.Object
-
- org.apache.synapse.message.store.impl.jms.JmsConsumer
-
- All Implemented Interfaces:
MessageConsumer
public class JmsConsumer extends Object implements MessageConsumer
-
-
Constructor Summary
Constructors Constructor Description JmsConsumer(JmsStore store)Constructor for JMS consumer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanack()Acknowledges the last message received so that it will be removed from the store.booleancleanup()Cleans up this message consumerjavax.jms.ConnectiongetConnection()javax.jms.MessageConsumergetConsumer()StringgetId()Returns the ID of this Message consumer.javax.jms.SessiongetSession()booleanisAlive()Check availability of connectivity with the message storebooleanisInitialized()MessageContextreceive()Receives the next message from the store.voidsetAlive(boolean isAlive)Set the connectivity state with the message storeJmsConsumersetConnection(javax.jms.Connection connection)JmsConsumersetConsumer(javax.jms.MessageConsumer consumer)voidsetId(int id)Sets the ID of this message consumer.JmsConsumersetSession(javax.jms.Session session)voidsetStringId(String idString)
-
-
-
Constructor Detail
-
JmsConsumer
public JmsConsumer(JmsStore store)
Constructor for JMS consumer- Parameters:
store- JMSStore associated to this JMS consumer
-
-
Method Detail
-
receive
public MessageContext receive()
Description copied from interface:MessageConsumerReceives the next message from the store.- Specified by:
receivein interfaceMessageConsumer- Returns:
- Synapse message context of the last message received from the store.
-
ack
public boolean ack()
Description copied from interface:MessageConsumerAcknowledges the last message received so that it will be removed from the store.- Specified by:
ackin interfaceMessageConsumer- Returns:
trueif the acknowledgement is successful.falseotherwise.
-
cleanup
public boolean cleanup() throws SynapseExceptionDescription copied from interface:MessageConsumerCleans up this message consumer- Specified by:
cleanupin interfaceMessageConsumer- Returns:
trueif cleanup is successful,falseotherwise.- Throws:
SynapseException
-
isAlive
public boolean isAlive()
Description copied from interface:MessageConsumerCheck availability of connectivity with the message store- Specified by:
isAlivein interfaceMessageConsumer- Returns:
trueif connection available,falseotherwise.
-
setAlive
public void setAlive(boolean isAlive)
Description copied from interface:MessageConsumerSet the connectivity state with the message store- Specified by:
setAlivein interfaceMessageConsumer- Parameters:
isAlive- if connection available.
-
getConnection
public javax.jms.Connection getConnection()
-
setConnection
public JmsConsumer setConnection(javax.jms.Connection connection)
-
getSession
public javax.jms.Session getSession()
-
setSession
public JmsConsumer setSession(javax.jms.Session session)
-
getConsumer
public javax.jms.MessageConsumer getConsumer()
-
setConsumer
public JmsConsumer setConsumer(javax.jms.MessageConsumer consumer)
-
isInitialized
public boolean isInitialized()
-
setId
public void setId(int id)
Description copied from interface:MessageConsumerSets the ID of this message consumer.- Specified by:
setIdin interfaceMessageConsumer- Parameters:
id- ID
-
setStringId
public void setStringId(String idString)
-
getId
public String getId()
Description copied from interface:MessageConsumerReturns the ID of this Message consumer.- Specified by:
getIdin interfaceMessageConsumer- Returns:
- ID
-
-