org.jboss.seam.jms
Interface MessageManager

All Superinterfaces:
Serializable
All Known Subinterfaces:
DurableMessageManager

public interface MessageManager
extends Serializable

The MessageBuilder interface defines an abstraction layer over the JMS APIs You can instances of this interface to create and send JMS Messages outbound.

Author:
johnament

Method Summary
 javax.jms.BytesMessage createBytesMessage(byte[] bytes)
          Creates a bytes message based on the byte[] payload
 JmsMessage createJmsMessage(Class<?> payloadType, Object payload)
           
 javax.jms.MapMessage createMapMessage(Map<Object,Object> map)
          Creates a MapMessage based on the Map payload provided.
 javax.jms.MessageConsumer createMessageConsumer(javax.jms.Destination destination, javax.jms.MessageListener... listeners)
          Creates a new MessageConsumer that will be managed by the used session
 javax.jms.MessageConsumer createMessageConsumer(javax.jms.Destination destination, String selector, javax.jms.MessageListener... listeners)
           
 javax.jms.MessageConsumer createMessageConsumer(String destination, javax.jms.MessageListener... listeners)
          Creates a new MessageConsumer that will be managed by the used session
 javax.jms.MessageConsumer createMessageConsumer(String destination, String selector, javax.jms.MessageListener... listeners)
           
 javax.jms.MessageProducer createMessageProducer(String destination)
          Creates a new MessageProducer that will be managed by the used session
 javax.jms.ObjectMessage createObjectMessage(Object object)
          Creates an object message based on the object payload provided.
 QueueBuilder createQueueBuilder()
          Creates a QueueBuilder, simple interface for working with Queues
 javax.jms.QueueReceiver createQueueReceiver(String destination, javax.jms.MessageListener... listeners)
          Creates a new QueueReceiver that will be managed by the used session
 javax.jms.QueueSender createQueueSender(javax.jms.Queue queue)
          Creates a QueueSender for the given queue.
 javax.jms.QueueSender createQueueSender(String destination)
          Creates a QueueSender for the given queue.
 javax.jms.TextMessage createTextMessage(String string)
          Creates a text message based on the String payload provided.
 TopicBuilder createTopicBuilder()
          Creates a TopicBuilder, simple interface for working with Topics.
 javax.jms.TopicPublisher createTopicPublisher(String destination)
          Creates a TopicPublisher for the given topic.
 javax.jms.TopicPublisher createTopicPublisher(javax.jms.Topic topic)
          Creates a TopicPublisher for the given topic.
 javax.jms.TopicSubscriber createTopicSubscriber(javax.jms.Destination destination, String selector, javax.jms.MessageListener... listeners)
           
 javax.jms.TopicSubscriber createTopicSubscriber(String destination, javax.jms.MessageListener... listeners)
          Creates a new TopicSubscriber that will be managed by the used session
 javax.jms.TopicSubscriber createTopicSubscriber(String destination, String selector, javax.jms.MessageListener... listeners)
           
 javax.jms.Session getSession()
          Exposes the underlying Session for public usage.
 javax.jms.Destination lookupDestination(String jndiName)
           
 void sendBytesToDestinations(byte[] bytes, javax.jms.Destination... destinations)
          Wrapper method for creating bytes message, then sending it to listed destinations.
 void sendBytesToDestinations(byte[] bytes, String... destinations)
          Sends a bytep[ (as an BytesMessage) to listed destinations.
 void sendMapToDestinations(Map map, javax.jms.Destination... destinations)
          Wrapper method for creating map message, then sending it to listed destinations.
 void sendMapToDestinations(Map map, String... destinations)
          Sends a map (as an MapMessage) to listed destinations.
 void sendMessage(javax.jms.Message message, javax.jms.Destination... destinations)
          Sends the given message to the list of destinations.
 void sendMessage(javax.jms.Message message, String... destinations)
          Utility methods for sending messages to a set of Strings that are the destinations
 void sendObjectToDestinations(Object object, javax.jms.Destination... destinations)
          Wrapper method for creating object message, then sending it to listed destinations.
 void sendObjectToDestinations(Object object, String... destinations)
          Sends an object (as an ObjectMessage) to listed destinations.
 void sendTextToDestinations(String string, javax.jms.Destination... destinations)
          Wrapper method for creating text message, then sending it to listed destinations.
 void sendTextToDestinations(String string, String... destinations)
          Sends a string (as an TextMessage) to listed destinations.
 

Method Detail

createObjectMessage

javax.jms.ObjectMessage createObjectMessage(Object object)
Creates an object message based on the object payload provided.

Parameters:
object - Object to use as payload.
Returns:
The ObjectMessage created. To interact with it, use the session provided.

createTextMessage

javax.jms.TextMessage createTextMessage(String string)
Creates a text message based on the String payload provided.

Parameters:
string - the payload
Returns:
A TextMessage based on the given string.

createMapMessage

javax.jms.MapMessage createMapMessage(Map<Object,Object> map)
Creates a MapMessage based on the Map payload provided. Keys are converted to strings, values are the objects.

Parameters:
map - the payload
Returns:
A MapMessage based on the given Map.

createBytesMessage

javax.jms.BytesMessage createBytesMessage(byte[] bytes)
Creates a bytes message based on the byte[] payload

Parameters:
bytes - the bytes to be written.
Returns:
the resulting BytesMessage with the payload already written.

sendMessage

void sendMessage(javax.jms.Message message,
                 String... destinations)
Utility methods for sending messages to a set of Strings that are the destinations

Parameters:
message - The message to be sent.
destinations - A sequence of JNDI names representing the destinations to distribute to.

sendObjectToDestinations

void sendObjectToDestinations(Object object,
                              String... destinations)
Sends an object (as an ObjectMessage) to listed destinations.

Parameters:
object - Payload of the object message.
destinations - A sequence of JNDI names representing the destinations to distribute to.

sendTextToDestinations

void sendTextToDestinations(String string,
                            String... destinations)
Sends a string (as an TextMessage) to listed destinations.

Parameters:
string - Payload of the text message.
destinations - A sequence of JNDI names representing the destinations to distribute to.

sendMapToDestinations

void sendMapToDestinations(Map map,
                           String... destinations)
Sends a map (as an MapMessage) to listed destinations.

Parameters:
map - Payload of the map message.
destinations - A sequence of JNDI names representing the destinations to distribute to.

sendBytesToDestinations

void sendBytesToDestinations(byte[] bytes,
                             String... destinations)
Sends a bytep[ (as an BytesMessage) to listed destinations.

Parameters:
bytes - Payload of the bytes message.
destinations - A sequence of JNDI names representing the destinations to distribute to.

sendMessage

void sendMessage(javax.jms.Message message,
                 javax.jms.Destination... destinations)
Sends the given message to the list of destinations.

Parameters:
message - The message to be sent.
destinations - an array of destinations to be sent to.

sendObjectToDestinations

void sendObjectToDestinations(Object object,
                              javax.jms.Destination... destinations)
Wrapper method for creating object message, then sending it to listed destinations.

Parameters:
object - the object to be sent as an object message.
destinations - destinations to be sent to.

sendTextToDestinations

void sendTextToDestinations(String string,
                            javax.jms.Destination... destinations)
Wrapper method for creating text message, then sending it to listed destinations.

Parameters:
string - the string data to be sent.
destinations - destinations to be sent to.

sendMapToDestinations

void sendMapToDestinations(Map map,
                           javax.jms.Destination... destinations)
Wrapper method for creating map message, then sending it to listed destinations.

Parameters:
map - the map object to be sent.
destinations - destinations to be sent to.

sendBytesToDestinations

void sendBytesToDestinations(byte[] bytes,
                             javax.jms.Destination... destinations)
Wrapper method for creating bytes message, then sending it to listed destinations.

Parameters:
bytes - the stream data to be sent.
destinations - destinations to be sent to.

getSession

javax.jms.Session getSession()
Exposes the underlying Session for public usage.


createMessageProducer

javax.jms.MessageProducer createMessageProducer(String destination)
Creates a new MessageProducer that will be managed by the used session

Parameters:
destination - JNDI Location of Destination in use
Returns:
a new MessageProducer that is ready to work.

createTopicPublisher

javax.jms.TopicPublisher createTopicPublisher(String destination)
Creates a TopicPublisher for the given topic.

Parameters:
destination - JNDI Location of Destination in use
Returns:
a new TopicPublisher that is ready to work.

createTopicPublisher

javax.jms.TopicPublisher createTopicPublisher(javax.jms.Topic topic)
Creates a TopicPublisher for the given topic.

Parameters:
destination - JNDI Location of Destination in use
Returns:
a new TopicPublisher that is ready to work.

createTopicBuilder

TopicBuilder createTopicBuilder()
Creates a TopicBuilder, simple interface for working with Topics.

Returns:
a new TopicBuilder

createQueueBuilder

QueueBuilder createQueueBuilder()
Creates a QueueBuilder, simple interface for working with Queues

Returns:
a new QueueBuilder

createQueueSender

javax.jms.QueueSender createQueueSender(String destination)
Creates a QueueSender for the given queue.

Parameters:
destination - JNDI Location of Destination in use
Returns:
a new QueueSender that is ready to work.

createQueueSender

javax.jms.QueueSender createQueueSender(javax.jms.Queue queue)
Creates a QueueSender for the given queue.

Parameters:
destination - JNDI Location of Destination in use
Returns:
a new QueueSender that is ready to work.

createMessageConsumer

javax.jms.MessageConsumer createMessageConsumer(String destination,
                                                javax.jms.MessageListener... listeners)
Creates a new MessageConsumer that will be managed by the used session

Parameters:
destination - JNDI Location of Destination in use
listeners - optional list of MessageListeners that will be bound to the consumer.
Returns:
a new MessageConsumer that is ready to work.

createMessageConsumer

javax.jms.MessageConsumer createMessageConsumer(javax.jms.Destination destination,
                                                javax.jms.MessageListener... listeners)
Creates a new MessageConsumer that will be managed by the used session

Parameters:
destination - JNDI Location of Destination in use
listeners - optional list of MessageListeners that will be bound to the consumer.
Returns:
a new MessageConsumer that is ready to work.

createTopicSubscriber

javax.jms.TopicSubscriber createTopicSubscriber(String destination,
                                                javax.jms.MessageListener... listeners)
Creates a new TopicSubscriber that will be managed by the used session

Parameters:
destination - JNDI Location of Topic in use
listeners - optional list of MessageListeners that will be bound to the subscriber.
Returns:
a new TopicSubscriber that is ready to work.

createQueueReceiver

javax.jms.QueueReceiver createQueueReceiver(String destination,
                                            javax.jms.MessageListener... listeners)
Creates a new QueueReceiver that will be managed by the used session

Parameters:
destination - JNDI Location of Queue in use
listeners - optional list of MessageListeners that will be bound to the receiver.
Returns:
a new QueueReceiver that is ready to work.

createMessageConsumer

javax.jms.MessageConsumer createMessageConsumer(javax.jms.Destination destination,
                                                String selector,
                                                javax.jms.MessageListener... listeners)

createMessageConsumer

javax.jms.MessageConsumer createMessageConsumer(String destination,
                                                String selector,
                                                javax.jms.MessageListener... listeners)

createTopicSubscriber

javax.jms.TopicSubscriber createTopicSubscriber(String destination,
                                                String selector,
                                                javax.jms.MessageListener... listeners)

createTopicSubscriber

javax.jms.TopicSubscriber createTopicSubscriber(javax.jms.Destination destination,
                                                String selector,
                                                javax.jms.MessageListener... listeners)

lookupDestination

javax.jms.Destination lookupDestination(String jndiName)

createJmsMessage

JmsMessage createJmsMessage(Class<?> payloadType,
                            Object payload)


Copyright © 2011 Seam Framework. All Rights Reserved.