org.jboss.soa.esb.listeners.gateway
Class RemoteFileMessageComposer<T extends java.io.File>

java.lang.Object
  extended by org.jboss.soa.esb.listeners.gateway.RemoteFileMessageComposer<T>
All Implemented Interfaces:
MessageComposer<T>

public class RemoteFileMessageComposer<T extends java.io.File>
extends java.lang.Object
implements MessageComposer<T>

Remote File Message Composer.

The logic in this class was lifeted from RemoteGatewayListener.

Author:
tom.fennelly@jboss.com
See Also:
LocalFileMessageComposer

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.soa.esb.listeners.message.MessageComposer
MessageComposer.Factory
 
Constructor Summary
RemoteFileMessageComposer()
           
 
Method Summary
 Message compose(T inputFile)
          Compose an ESB "aware" message from the supplied message payload.
 java.lang.Object decompose(Message message, T inputMessage)
          Decompose an ESB "aware" message, extracting and returning the message payload.
 void setConfiguration(ConfigTree config)
          Set the composer's configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RemoteFileMessageComposer

public RemoteFileMessageComposer()
Method Detail

setConfiguration

public void setConfiguration(ConfigTree config)
                      throws ConfigurationException
Description copied from interface: MessageComposer
Set the composer's configuration.

Specified by:
setConfiguration in interface MessageComposer<T extends java.io.File>
Parameters:
config - Composer configuration.
Throws:
ConfigurationException - Bad configuration.

compose

public Message compose(T inputFile)
                throws MessageDeliverException
Description copied from interface: MessageComposer
Compose an ESB "aware" message from the supplied message payload.

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

Specified by:
compose in interface MessageComposer<T extends java.io.File>
Parameters:
inputFile - 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

public java.lang.Object decompose(Message message,
                                  T inputMessage)
                           throws MessageDeliverException
Description copied from interface: MessageComposer
Decompose an ESB "aware" message, extracting and returning the message payload.

Specified by:
decompose in interface MessageComposer<T extends java.io.File>
Parameters:
message - ESB aware message instance to be decomposed.
inputMessage - The original input message payload used to compose this (or ther original) message. The original message can sometimes contain information relevant during the decomposition process. Whether or not this parameter can be null depends on the MessageComposer implementation.
Returns:
ESB unaware message instance - a message payload.
Throws:
MessageDeliverException - Failed to decompose message payload.