org.springframework.jms.core
Interface MessageCreator


public interface MessageCreator

The callback interface used by JmsTemplate. This interface creates a JMS message given a session, provided by the JmsTemplate.

Implementations do not need to concern themselves with checked JMSException (from javax.jms) that may be thrown from operations they attempt. The JmsTemplate will catch and handle these JMSExceptions appropriately.

If extra parameters need to be set, such as the delivery mode, priority or time to live, override any of the getters with your own implementation.

Author:
Mark Pollack
Since: 1.1

Method Summary
 MessagecreateMessage(Session session)
          Implement this method to return a message to be sent.

Method Detail

createMessage

public Message createMessage(Session session)
throws JMSException
Implement this method to return a message to be sent.
Parameters:
session - the JMS session
Returns: the message to be sentt
Throws:
javax.jms.JMSException - if thrown by JMS API methods