|
||||||||||
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.SimpleMessenger
public class SimpleMessenger
SimpleMessenger
is an implementation of
Messenger which uses a single JMS Session for sending
to keep the JMS Session that should be used for a given calling thread.
Nested Class Summary | |
---|---|
protected static class |
SimpleMessenger.ThreadLocalData
|
Constructor Summary | |
---|---|
SimpleMessenger()
|
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 |
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 |
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 |
protected SimpleMessenger.ThreadLocalData |
getThreadLocalData(javax.jms.Session session)
|
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 SimpleMessenger()
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 SimpleMessenger.ThreadLocalData getThreadLocalData(javax.jms.Session session) throws javax.jms.JMSException
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 MessengerSession createMessengerSession() throws javax.jms.JMSException
javax.jms.JMSException
protected SessionFactory createSessionFactory() 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |