|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.messenger.MessengerSupport org.apache.commons.messenger.DefaultMessenger
public class DefaultMessenger
DefaultMessenger
is the default implementation of
Messenger which uses a ThreadLocal
variable
to keep the JMS Session that should be used for a given calling thread.
Constructor Summary | |
---|---|
DefaultMessenger()
|
Method Summary | |
---|---|
protected MessengerSession |
borrowMessengerSession()
|
javax.jms.Message |
call(javax.jms.Destination destination,
javax.jms.Message message)
Sends a message on the given destination and blocks until a response is returned |
javax.jms.Message |
call(javax.jms.Destination destination,
javax.jms.Message message,
long timeoutMillis)
Sends a message on the given destination and blocks until a response is returned or the given timeout period expires |
protected void |
clearReplyToDestination()
Clears the temporary destination used to receive reply-to messages which will lazily force a new destination and consumer to be created next time a call() method is invoked. |
void |
close()
Closes the underlying JMS connection |
protected MessengerSession |
createMessengerSession()
Factory method to create a new MessengerSession |
javax.jms.ServerSessionPool |
createServerSessionPool(javax.jms.MessageListener messageListener,
int maxThreads)
Creates a new ServerSessionPool implementation with a given maximum number of threads for use by a ConnectionConsumer |
protected SessionFactory |
createSessionFactory()
Factory method to create a SessionFactory. |
javax.jms.Session |
getAsyncSession()
Returns the underlying JMS session that this thread is using for this Messenger for asynchronous operation such as addMessageListener() operations |
javax.jms.Connection |
getConnection()
Returns the underlying JMS connection that this Messenger is using |
protected MessengerSession |
getMessengerSession()
|
javax.jms.Queue |
getQueue(javax.jms.QueueSession session,
String subject)
|
protected javax.jms.MessageConsumer |
getReplyToConsumer()
|
protected javax.jms.Destination |
getReplyToDestination()
|
javax.jms.Session |
getSession()
Returns the underlying JMS session that this thread is using for synchronous operations such as send() and receive() for synchronous operation |
SessionFactory |
getSessionFactory()
Returns the SessionFactory used to create new JMS sessions |
javax.jms.Topic |
getTopic(javax.jms.TopicSession session,
String subject)
|
protected boolean |
isTopic(javax.jms.Connection connection)
|
protected boolean |
isTopic(javax.jms.ConnectionFactory factory)
|
protected void |
returnMessengerSession(MessengerSession session)
|
void |
setSessionFactory(SessionFactory sessionFactory)
Sets the SessionFactory used to create new JMS sessions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DefaultMessenger()
Method Detail |
---|
public SessionFactory getSessionFactory() throws javax.jms.JMSException
javax.jms.JMSException
public void setSessionFactory(SessionFactory sessionFactory)
public javax.jms.Connection getConnection() throws javax.jms.JMSException
Messenger
getConnection
in interface Messenger
getConnection
in class MessengerSupport
javax.jms.JMSException
public javax.jms.ServerSessionPool createServerSessionPool(javax.jms.MessageListener messageListener, int maxThreads) throws javax.jms.JMSException
Messenger
javax.jms.JMSException
public void close() throws javax.jms.JMSException
Messenger
close
in interface Messenger
close
in class MessengerSupport
javax.jms.JMSException
public javax.jms.Session getSession() throws javax.jms.JMSException
Messenger
javax.jms.JMSException
public javax.jms.Session getAsyncSession() throws javax.jms.JMSException
Messenger
javax.jms.JMSException
public javax.jms.Message call(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
Messenger
javax.jms.JMSException
public javax.jms.Message call(javax.jms.Destination destination, javax.jms.Message message, long timeoutMillis) throws javax.jms.JMSException
Messenger
javax.jms.JMSException
protected boolean isTopic(javax.jms.Connection connection) throws javax.jms.JMSException
isTopic
in class MessengerSupport
javax.jms.JMSException
protected boolean isTopic(javax.jms.ConnectionFactory factory) throws javax.jms.JMSException
isTopic
in class MessengerSupport
javax.jms.JMSException
protected javax.jms.MessageConsumer getReplyToConsumer() throws javax.jms.JMSException
javax.jms.JMSException
protected void clearReplyToDestination() throws javax.jms.JMSException
javax.jms.JMSException
protected javax.jms.Destination getReplyToDestination() throws javax.jms.JMSException
javax.jms.JMSException
protected MessengerSession getMessengerSession() throws javax.jms.JMSException
javax.jms.JMSException
protected MessengerSession borrowMessengerSession() throws javax.jms.JMSException
borrowMessengerSession
in class MessengerSupport
javax.jms.JMSException
protected void returnMessengerSession(MessengerSession session)
returnMessengerSession
in class MessengerSupport
protected MessengerSession createMessengerSession() throws javax.jms.JMSException
javax.jms.JMSException
protected SessionFactory createSessionFactory() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Queue getQueue(javax.jms.QueueSession session, String subject) throws javax.jms.JMSException
getQueue
in class MessengerSupport
javax.jms.JMSException
public javax.jms.Topic getTopic(javax.jms.TopicSession session, String subject) throws javax.jms.JMSException
getTopic
in class MessengerSupport
javax.jms.JMSException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |