|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Messenger
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,
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,
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,
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(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(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(String subject)
Returns the destination for the given subject name |
boolean |
getDisableMessageID(javax.jms.Destination destination)
|
boolean |
getDisableMessageTimestamp(javax.jms.Destination destination)
|
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,
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,
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,
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,
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 |
---|
String getName()
javax.jms.Destination getDestination(String subject) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Destination createTemporaryDestination() throws javax.jms.JMSException
javax.jms.JMSException
void send(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message call(javax.jms.Destination destination, javax.jms.Message message) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message call(javax.jms.Destination destination, javax.jms.Message message, long timeoutMillis) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message receive(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message receive(javax.jms.Destination destination, String selector) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message receive(javax.jms.Destination destination, long timeoutMillis) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message receive(javax.jms.Destination destination, String selector, long timeoutMillis) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message receiveNoWait(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message receiveNoWait(javax.jms.Destination destination, String selector) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.MessageConsumer createConsumer(javax.jms.Destination destination, String selector) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.QueueBrowser createBrowser(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
void run()
javax.jms.Connection getConnection() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Session getSession() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Session getAsyncSession() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.ConnectionConsumer createConnectionConsumer(javax.jms.Destination destination, String selector, javax.jms.ServerSessionPool sessionPool, int maxMessages) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.ServerSessionPool createServerSessionPool(javax.jms.MessageListener messageListener, int maxThreads) throws javax.jms.JMSException
javax.jms.JMSException
void addListener(javax.jms.Destination destination, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
void addListener(javax.jms.Destination destination, String selector, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
void removeListener(javax.jms.Destination destination, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
void removeListener(javax.jms.Destination destination, String selector, javax.jms.MessageListener listener) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.BytesMessage createBytesMessage() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.MapMessage createMapMessage() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.Message createMessage() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.ObjectMessage createObjectMessage() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.ObjectMessage createObjectMessage(Serializable object) throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.StreamMessage createStreamMessage() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.TextMessage createTextMessage() throws javax.jms.JMSException
javax.jms.JMSException
javax.jms.TextMessage createTextMessage(String text) throws javax.jms.JMSException
javax.jms.JMSException
void commit() throws javax.jms.JMSException
javax.jms.JMSException
void rollback() throws javax.jms.JMSException
javax.jms.JMSException
void close() throws javax.jms.JMSException
javax.jms.JMSException
SessionFactory getSessionFactory() throws javax.jms.JMSException
javax.jms.JMSException
int getDeliveryMode(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
boolean getDisableMessageID(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
boolean getDisableMessageTimestamp(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
int getPriority(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
long getTimeToLive(javax.jms.Destination destination) throws javax.jms.JMSException
javax.jms.JMSException
void setDeliveryMode(javax.jms.Destination destination, int deliveryMode) throws javax.jms.JMSException
javax.jms.JMSException
void setDisableMessageID(javax.jms.Destination destination, boolean value) throws javax.jms.JMSException
javax.jms.JMSException
void setDisableMessageTimestamp(javax.jms.Destination destination, boolean value) throws javax.jms.JMSException
javax.jms.JMSException
void setPriority(javax.jms.Destination destination, int defaultPriority) throws javax.jms.JMSException
javax.jms.JMSException
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 |