org.jboss.soa.esb.message.format
Class MessageFactory

java.lang.Object
  extended by org.jboss.soa.esb.message.format.MessageFactory

public abstract class MessageFactory
extends java.lang.Object

You get a message of a specific type when you need it. Obviously that type may not be suitable for the service (hopefully you've got that contractual information a priori, but maybe not) and in which case some translation/transformation may be necessary. Different ways of viewing and manipulating the Message Body (payload) are available separately via the Payload class. In future releases it will be possible to define the payload type at creation time.

Author:
Mark Little

Constructor Summary
MessageFactory()
           
 
Method Summary
abstract  java.lang.Object createBodyType(Message m, java.lang.String bodyType)
          Given a Message, return the Body component as a specific type for manipulation, e.g., TextMessage or BytesMessage.
static MessageFactory getInstance()
           
abstract  Message getMessage()
           
abstract  Message getMessage(Message msg, java.net.URI type)
          Deprecated. Not implemented in 4.2.
abstract  Message getMessage(java.net.URI type)
           
abstract  void reset()
          Reload the plugins.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageFactory

public MessageFactory()
Method Detail

getMessage

public abstract Message getMessage()
Returns:
the default implementation.

getMessage

public abstract Message getMessage(java.net.URI type)
Parameters:
type - the unique identifier representing the type of this message.
Returns:
the message, or null if no suitable plugin is available.

getMessage

public abstract Message getMessage(Message msg,
                                   java.net.URI type)
Deprecated. Not implemented in 4.2.

Parameters:
msg - the message to convert.
type - the type of the message we want to convert to.
Returns:
a translated message, or null if no suitable plugin is available.

reset

public abstract void reset()
Reload the plugins.


createBodyType

public abstract java.lang.Object createBodyType(Message m,
                                                java.lang.String bodyType)
Given a Message, return the Body component as a specific type for manipulation, e.g., TextMessage or BytesMessage.

Parameters:
m - the Message
bodyType - the type of Body to "cast" to.
Returns:
the Body.

getInstance

public static MessageFactory getInstance()