|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Messenger
a facade over the JMS API making it easy to use JMS
and hiding much of the complexity of threading and configuration.
A Messenger will internally associate a JMS Session with the calling thread
so that all methods called in the same thread (such as inside a Servlet or
taglib) will use the same JMS Session.
Method Summary | |
void |
addListener(javax.jms.Destination destination,
javax.jms.MessageListener listener)
Adds a message listener on the given destination |
void |
addListener(javax.jms.Destination destination,
java.lang.String selector,
javax.jms.MessageListener listener)
|
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 |
void |
commit()
Commits all messages done in this thread and releases any locks |
javax.jms.QueueBrowser |
createBrowser(javax.jms.Destination destination)
Creates a QueueBrowser for the given Queue |
javax.jms.BytesMessage |
createBytesMessage()
|
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a ConnectionConsumer which is useful if used inside an application server to associate multiple threads with consuming from a JMS destination |
javax.jms.ConnectionConsumer |
createConnectionConsumer(javax.jms.Destination destination,
java.lang.String selector,
javax.jms.ServerSessionPool sessionPool,
int maxMessages)
Creates a ConnectionConsumer which is useful if used inside an application server to associate multiple threads with consuming from a JMS destination |
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination)
Creates a MessageConsumer for the given JMS Desintation |
javax.jms.MessageConsumer |
createConsumer(javax.jms.Destination destination,
java.lang.String selector)
Creates a MessageConsumer for the given JMS Desintation and JMS selector |
javax.jms.MapMessage |
createMapMessage()
|
javax.jms.Message |
createMessage()
|
javax.jms.ObjectMessage |
createObjectMessage()
|
javax.jms.ObjectMessage |
createObjectMessage(java.io.Serializable object)
|
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 |
javax.jms.StreamMessage |
createStreamMessage()
|
javax.jms.Destination |
createTemporaryDestination()
Returns a new temporary destination |
javax.jms.TextMessage |
createTextMessage()
|
javax.jms.TextMessage |
createTextMessage(java.lang.String text)
|
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 |
int |
getDeliveryMode(javax.jms.Destination destination)
|
javax.jms.Destination |
getDestination(java.lang.String subject)
Returns the destination for the given subject name |
boolean |
getDisableMessageID(javax.jms.Destination destination)
|
boolean |
getDisableMessageTimestamp(javax.jms.Destination destination)
|
java.lang.String |
getName()
Temporary hack - this method has been added so that Messenger works better with the digester |
int |
getPriority(javax.jms.Destination destination)
|
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 and Connections. |
long |
getTimeToLive(javax.jms.Destination destination)
|
javax.jms.Message |
receive(javax.jms.Destination destination)
Receives a message on the given destination, blocking until one is returned |
javax.jms.Message |
receive(javax.jms.Destination destination,
long timeoutMillis)
Receives a message on the given destination, blocking for the specified timeout |
javax.jms.Message |
receive(javax.jms.Destination destination,
java.lang.String selector)
Receives a message on the given destination and message selector, blocking until one is returned |
javax.jms.Message |
receive(javax.jms.Destination destination,
java.lang.String selector,
long timeoutMillis)
Receives a message on the given destination and selector, blocking for the specified timeout |
javax.jms.Message |
receiveNoWait(javax.jms.Destination destination)
Receives a message on the given destination without blocking or returns null |
javax.jms.Message |
receiveNoWait(javax.jms.Destination destination,
java.lang.String selector)
Receives a message on the given destination and selector without blocking or returns null |
void |
removeListener(javax.jms.Destination destination,
javax.jms.MessageListener listener)
|
void |
removeListener(javax.jms.Destination destination,
java.lang.String selector,
javax.jms.MessageListener listener)
|
void |
rollback()
Rolls back any messages done in this thread and releases any locks |
void |
run()
Allows this current thread to be given to the JMS connection to process messages. |
void |
send(javax.jms.Destination destination,
javax.jms.Message message)
Sends a message on the given destination |
void |
setDeliveryMode(javax.jms.Destination destination,
int deliveryMode)
|
void |
setDisableMessageID(javax.jms.Destination destination,
boolean value)
|
void |
setDisableMessageTimestamp(javax.jms.Destination destination,
boolean value)
|
void |
setPriority(javax.jms.Destination destination,
int defaultPriority)
|
void |
setTimeToLive(javax.jms.Destination destination,
long timeToLive)
|
Method Detail |
public java.lang.String getName()
public javax.jms.Destination getDestination(java.lang.String subject) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Destination createTemporaryDestination() throws javax.jms.JMSException
javax.jms.JMSException
public void send(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message call(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message call(javax.jms.Destination destination, javax.jms.Message message, long timeoutMillis) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message receive(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message receive(javax.jms.Destination destination, java.lang.String selector) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message receive(javax.jms.Destination destination, long timeoutMillis) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message receive(javax.jms.Destination destination, java.lang.String selector, long timeoutMillis) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message receiveNoWait(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message receiveNoWait(javax.jms.Destination destination, java.lang.String selector) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, java.lang.String selector) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.QueueBrowser createBrowser(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public void run()
public javax.jms.Connection getConnection() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Session getSession() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Session getAsyncSession() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, java.lang.String selector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ServerSessionPool createServerSessionPool(javax.jms.MessageListener messageListener, int maxThreads) throws javax.jms.JMSException
javax.jms.JMSException
public void addListener(javax.jms.Destination destination, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
public void addListener(javax.jms.Destination destination, java.lang.String selector, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
public void removeListener(javax.jms.Destination destination, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
public void removeListener(javax.jms.Destination destination, java.lang.String selector, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.Message createMessage() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.ObjectMessage createObjectMessage(java.io.Serializable object) throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
javax.jms.JMSException
public javax.jms.TextMessage createTextMessage(java.lang.String text) throws javax.jms.JMSException
javax.jms.JMSException
public void commit() throws javax.jms.JMSException
javax.jms.JMSException
public void rollback() throws javax.jms.JMSException
javax.jms.JMSException
public void close() throws javax.jms.JMSException
javax.jms.JMSException
public SessionFactory getSessionFactory() throws javax.jms.JMSException
javax.jms.JMSException
public int getDeliveryMode(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public boolean getDisableMessageID(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public boolean getDisableMessageTimestamp(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public int getPriority(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public long getTimeToLive(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
public void setDeliveryMode(javax.jms.Destination destination, int deliveryMode) throws javax.jms.JMSException
javax.jms.JMSException
public void setDisableMessageID(javax.jms.Destination destination, boolean value) throws javax.jms.JMSException
javax.jms.JMSException
public void setDisableMessageTimestamp(javax.jms.Destination destination, boolean value) throws javax.jms.JMSException
javax.jms.JMSException
public void setPriority(javax.jms.Destination destination, int defaultPriority) throws javax.jms.JMSException
javax.jms.JMSException
public void setTimeToLive(javax.jms.Destination destination, long timeToLive) throws javax.jms.JMSException
javax.jms.JMSException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |