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 boolean
ack()
Acknowledges the last message received so that it will be removed from the store.boolean
cleanup()
Cleans up this message consumerjavax.jms.Connection
getConnection()
javax.jms.MessageConsumer
getConsumer()
String
getId()
Returns the ID of this Message consumer.javax.jms.Session
getSession()
boolean
isAlive()
Check availability of connectivity with the message storeboolean
isInitialized()
MessageContext
receive()
Receives the next message from the store.void
setAlive(boolean isAlive)
Set the connectivity state with the message storeJmsConsumer
setConnection(javax.jms.Connection connection)
JmsConsumer
setConsumer(javax.jms.MessageConsumer consumer)
void
setId(int id)
Sets the ID of this message consumer.JmsConsumer
setSession(javax.jms.Session session)
void
setStringId(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:MessageConsumer
Receives the next message from the store.- Specified by:
receive
in interfaceMessageConsumer
- Returns:
- Synapse message context of the last message received from the store.
-
ack
public boolean ack()
Description copied from interface:MessageConsumer
Acknowledges the last message received so that it will be removed from the store.- Specified by:
ack
in interfaceMessageConsumer
- Returns:
true
if the acknowledgement is successful.false
otherwise.
-
cleanup
public boolean cleanup() throws SynapseException
Description copied from interface:MessageConsumer
Cleans up this message consumer- Specified by:
cleanup
in interfaceMessageConsumer
- Returns:
true
if cleanup is successful,false
otherwise.- Throws:
SynapseException
-
isAlive
public boolean isAlive()
Description copied from interface:MessageConsumer
Check availability of connectivity with the message store- Specified by:
isAlive
in interfaceMessageConsumer
- Returns:
true
if connection available,false
otherwise.
-
setAlive
public void setAlive(boolean isAlive)
Description copied from interface:MessageConsumer
Set the connectivity state with the message store- Specified by:
setAlive
in 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:MessageConsumer
Sets the ID of this message consumer.- Specified by:
setId
in interfaceMessageConsumer
- Parameters:
id
- ID
-
setStringId
public void setStringId(String idString)
-
getId
public String getId()
Description copied from interface:MessageConsumer
Returns the ID of this Message consumer.- Specified by:
getId
in interfaceMessageConsumer
- Returns:
- ID
-
-