org.jboss.soa.esb.listeners.message
Interface MessageComposer

All Known Implementing Classes:
AbstractMessageComposer, BasicMessageComposer, JBossRemotingGatewayListener.JBossRemotingMessageComposer

public interface MessageComposer

Message composer.

A "Composer" is basically a "Builder" ala the GoF patterns.

Implementations should be threadsafe (stateless) and must contain a public default constructor.

Author:
tom.fennelly@jboss.com

Nested Class Summary
static class MessageComposer.Factory
          Uitility factory class for reflective MessageComposer construction.
 
Method Summary
 Message compose(java.lang.Object messagePayload)
          Compose an ESB "aware" message from the supplied message payload.
 java.lang.Object decompose(Message message)
          Decompose an ESB "aware" message, extracting and returning the message payload.
 void setConfiguration(ConfigTree config)
          Set the conposer's configuration.
 

Method Detail

setConfiguration

void setConfiguration(ConfigTree config)
Set the conposer's configuration.

Parameters:
config - Composer configuration.

compose

Message compose(java.lang.Object messagePayload)
                throws MessageDeliverException
Compose an ESB "aware" message from the supplied message payload.

Implementations need to construct and populate an ESB Message from the messagePayload instance.

Parameters:
messagePayload - Message payload to be packaged, or a channel specific container class for the message payload (e.g. a JMS message).
Returns:
ESB aware message instance.
Throws:
MessageDeliverException - Failed to compose message payload for delivery.

decompose

java.lang.Object decompose(Message message)
                           throws MessageDeliverException
Decompose an ESB "aware" message, extracting and returning the message payload.

Parameters:
message - ESB aware message instance to be decomposed.
Returns:
ESB unaware message instance - a message payload.
Throws:
MessageDeliverException - Failed to decompose message payload.