org.servicemix.components.util
Interface FileMarshaler

All Known Implementing Classes:
DefaultFileMarshaler

public interface FileMarshaler

A pluggable strategy for turning a file or URL input source into a normalized message.

Version:
$Revision: 1.1 $

Method Summary
 String getOutputName(MessageExchange exchange, NormalizedMessage message)
          Creates a output file name for the given exchange when reading an inbound message.
 void readMessage(MessageExchange exchange, NormalizedMessage message, InputStream in, String name)
          Converts the file stream to a normalized message.
 void writeMessage(MessageExchange exchange, NormalizedMessage message, OutputStream out, String name)
          Writes the inbound message to the destination stream of the given name
 

Method Detail

readMessage

public void readMessage(MessageExchange exchange,
                        NormalizedMessage message,
                        InputStream in,
                        String name)
                 throws IOException,
                        JBIException
Converts the file stream to a normalized message.

Parameters:
exchange - the message exchange
message - the message to populate
in - the input stream
name - the name of the file, URI or URL
Throws:
IOException
JBIException

getOutputName

public String getOutputName(MessageExchange exchange,
                            NormalizedMessage message)
                     throws MessagingException
Creates a output file name for the given exchange when reading an inbound message.

Parameters:
exchange - the inbound message exchange
message - the inbound message
Returns:
the file name or null if a file name could not be found or calculated
Throws:
MessagingException

writeMessage

public void writeMessage(MessageExchange exchange,
                         NormalizedMessage message,
                         OutputStream out,
                         String name)
                  throws MessagingException,
                         TransformerException
Writes the inbound message to the destination stream of the given name

Parameters:
exchange - the inbound message exchange
message - the inbound message
out - the output stream to write to
name -
Throws:
MessagingException
TransformerException


Copyright © 2005 ServiceMix.. All Rights Reserved.