|
jBroker® MQ 2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sssw.jms.api.JMQMessageBean
A jBroker MQ utility class for easy creation of message consumers.
This class supports a variety of constructors that automatically
initializes the connection, session, and consumer for messaging.
Developers can extend this class and just provide an implementation
of the onMessage
method.
Constructor Summary | |
JMQMessageBean(Connection connection,
Destination destination)
This constructor creates a message bean, which is connected to destination :
If destination is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener. |
|
JMQMessageBean(Connection connection,
Destination destination,
String selector)
This constructor creates a message bean, which is connected to destination :
If destination is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener. |
|
JMQMessageBean(ConnectionFactory factory,
Destination destination)
This constructor creates a message bean, which is connected to destination :
If destination is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener. |
|
JMQMessageBean(ConnectionFactory factory,
Destination destination,
String selector)
This constructor creates a message bean, which is connected to destination :
If destination is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener. |
Method Summary | |
Connection |
getConnection()
Returns the connection created by this message bean. |
ConnectionFactory |
getConnectionFactory()
Returns the connection factory created by this message bean. |
MessageConsumer |
getConsumer()
Returns the message consumer created by this message bean. |
String |
getSelector()
Returns the selector set on message consumer, or null if no selector was specified. |
Session |
getSession()
Returns the session created by this message bean. |
void |
run()
Block until the calling thread is interrupted. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.jms.MessageListener |
onMessage |
Constructor Detail |
public JMQMessageBean(ConnectionFactory factory, Destination destination) throws JMSException
destination
:
destination
is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener.
destination
is a topic, the constructor
creates a topic connection, a topic session, and a topic
subscriber on which this object is set as the message listener.
AUTO_ACKNOWLEDGE
.factory
- the factory to use when creating the consumerdestination
- the destination where consumer will be connectedJMSException
- if connecting consumer failedJMQMessageBean(ConnectionFactory,Destination,String)
public JMQMessageBean(ConnectionFactory factory, Destination destination, String selector) throws JMSException
destination
:
destination
is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener.
destination
is a topic, the constructor
creates a topic connection, a topic session, and a topic
subscriber on which this object is set as the message listener.
AUTO_ACKNOWLEDGE
.factory
- the factory to use when creating the consumerdestination
- the destination where consumer will be connectedselector
- the selector set on the consumerJMSException
- if connecting consumer failedJMQMessageBean(Connection,Destination,String)
public JMQMessageBean(Connection connection, Destination destination) throws JMSException
destination
:
destination
is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener.
destination
is a topic, the constructor
creates a topic connection, a topic session, and a topic
subscriber on which this object is set as the message listener.
AUTO_ACKNOWLEDGE
.connection
- the connection to use when creating the consumerdestination
- the destination where consumer will be connectedJMSException
- if connecting consumer failedJMQMessageBean(Connection,Destination,String)
public JMQMessageBean(Connection connection, Destination destination, String selector) throws JMSException
destination
:
destination
is a queue, the constructor
creates a queue connection, a queue session, and a queue
receiver on which this object is set as the message listener.
destination
is a topic, the constructor
creates a topic connection, a topic session, and a topic
subscriber on which this object is set as the message listener.
AUTO_ACKNOWLEDGE
.connection
- the connection to use when creating the consumerdestination
- the destination where consumer will be connectedselector
- the selector set on the consumerJMSException
- if connecting consumer failedMethod Detail |
public ConnectionFactory getConnectionFactory()
public Connection getConnection()
public Session getSession()
public MessageConsumer getConsumer()
public String getSelector()
public void run()
wait
method is simpy called.
|
jBroker® MQ 2.1 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |