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
 BytesMessage createBytesMessage(byte[] bytes)
          Creates a bytes message based on the byte[] payload
 JmsMessage createJmsMessage(Class<?> payloadType, Object payload)
           
 MapMessage createMapMessage(Map<Object,Object> map)
          Creates a MapMessage based on the Map payload provided.
 MessageConsumer createMessageConsumer(Destination destination, MessageListener... listeners)
          Creates a new MessageConsumer that will be managed by the used session
 MessageConsumer createMessageConsumer(Destination destination, String selector, MessageListener... listeners)
           
 MessageConsumer createMessageConsumer(String destination, MessageListener... listeners)
          Creates a new MessageConsumer that will be managed by the used session
 MessageConsumer createMessageConsumer(String destination, String selector, MessageListener... listeners)
           
 MessageProducer createMessageProducer(String destination)
          Creates a new MessageProducer that will be managed by the used session
 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
 QueueReceiver createQueueReceiver(String destination, MessageListener... listeners)
          Creates a new QueueReceiver that will be managed by the used session
 QueueSender createQueueSender(Queue queue)
          Creates a QueueSender for the given queue.
 QueueSender createQueueSender(String destination)
          Creates a QueueSender for the given queue.
 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.
 TopicPublisher createTopicPublisher(String destination)
          Creates a TopicPublisher for the given topic.
 TopicPublisher createTopicPublisher(Topic topic)
          Creates a TopicPublisher for the given topic.
 TopicSubscriber createTopicSubscriber(Destination destination, String selector, MessageListener... listeners)
           
 TopicSubscriber createTopicSubscriber(String destination, MessageListener... listeners)
          Creates a new TopicSubscriber that will be managed by the used session
 TopicSubscriber createTopicSubscriber(String destination, String selector, MessageListener... listeners)
           
 Session getSession()
          Exposes the underlying Session for public usage.
 Destination lookupDestination(String jndiName)
           
 void sendBytesToDestinations(byte[] bytes, 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, 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(Message message, Destination... destinations)
          Sends the given message to the list of destinations.
 void sendMessage(Message message, String... destinations)
          Utility methods for sending messages to a set of Strings that are the destinations
 void sendObjectToDestinations(Object object, 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, 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

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

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

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

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(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(Message message,
                 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,
                              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,
                            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,
                           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,
                             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

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


createMessageProducer

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

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

TopicPublisher createTopicPublisher(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

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

QueueSender createQueueSender(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

MessageConsumer createMessageConsumer(String destination,
                                      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

MessageConsumer createMessageConsumer(Destination destination,
                                      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

TopicSubscriber createTopicSubscriber(String destination,
                                      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

QueueReceiver createQueueReceiver(String destination,
                                  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

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

createMessageConsumer

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

createTopicSubscriber

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

createTopicSubscriber

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

lookupDestination

Destination lookupDestination(String jndiName)

createJmsMessage

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


Copyright © 2011 Seam Framework. All Rights Reserved.