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

java.lang.Object
  extended by org.jboss.soa.esb.listeners.gateway.LocalFileMessageComposer<T>
All Implemented Interfaces:
MessageComposer<T>
Direct Known Subclasses:
LocalFileNameMessageComposer

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

Local File Message Composer.

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

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.jboss.soa.esb.listeners.message.MessageComposer
MessageComposer.Factory
 
Field Summary
static java.lang.String PROP_FILE_LASTMOD
           
static java.lang.String PROP_FILE_LENGTH
           
static java.lang.String PROP_FILE_OBJ
           
static java.lang.String PROP_FILE_PATH
           
 
Constructor Summary
LocalFileMessageComposer()
           
 
Method Summary
 Message compose(T inputFile)
          Compose an ESB "aware" message from the supplied message payload.
 java.lang.Object decompose(Message message, T inputFile)
          Decompose an ESB "aware" message, extracting and returning the message payload.
protected  java.lang.Object getPayload(T inputFile)
           
 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
 

Field Detail

PROP_FILE_OBJ

public static final java.lang.String PROP_FILE_OBJ
See Also:
Constant Field Values

PROP_FILE_PATH

public static final java.lang.String PROP_FILE_PATH
See Also:
Constant Field Values

PROP_FILE_LENGTH

public static final java.lang.String PROP_FILE_LENGTH
See Also:
Constant Field Values

PROP_FILE_LASTMOD

public static final java.lang.String PROP_FILE_LASTMOD
See Also:
Constant Field Values
Constructor Detail

LocalFileMessageComposer

public LocalFileMessageComposer()
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.

getPayload

protected java.lang.Object getPayload(T inputFile)
                               throws java.io.IOException
Throws:
java.io.IOException

decompose

public java.lang.Object decompose(Message message,
                                  T inputFile)
                           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.
inputFile - 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.