org.apache.synapse.format.hessian
Class HessianMessageFormatter

java.lang.Object
  extended by org.apache.synapse.format.hessian.HessianMessageFormatter
All Implemented Interfaces:
MessageFormatter

public class HessianMessageFormatter
extends Object
implements MessageFormatter

Enables a message encoded using the Hessian binary protocol to be written to transport by axis2/synapse and this formats the HessianDataSource to a Hessian message.

See Also:
MessageFormatter, SynapseBinaryDataSource

Constructor Summary
HessianMessageFormatter()
           
 
Method Summary
 String formatSOAPAction(MessageContext messageContext, OMOutputFormat format, String soapAction)
           Simply returns the soapAction unchanged.
 byte[] getBytes(MessageContext msgCtxt, OMOutputFormat format)
          This method is not supported because of large file handling limitations
 String getContentType(MessageContext msgCtxt, OMOutputFormat format, String soapActionString)
          Formats the content type to be written in to the transport
 URL getTargetAddress(MessageContext messageContext, OMOutputFormat format, URL targetURL)
          
 void writeTo(MessageContext msgCtx, OMOutputFormat format, OutputStream out, boolean preserve)
          Extract Hessian bytes from the received SOAP message and write it onto the wire
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HessianMessageFormatter

public HessianMessageFormatter()
Method Detail

getContentType

public String getContentType(MessageContext msgCtxt,
                             OMOutputFormat format,
                             String soapActionString)
Formats the content type to be written in to the transport

Specified by:
getContentType in interface MessageFormatter
Parameters:
msgCtxt - message of which the content type has to be formatted
format - fomat of the expected formatted message
soapActionString - soap action of the message
Returns:
contentType formatted content type as a String

writeTo

public void writeTo(MessageContext msgCtx,
                    OMOutputFormat format,
                    OutputStream out,
                    boolean preserve)
             throws AxisFault
Extract Hessian bytes from the received SOAP message and write it onto the wire

Specified by:
writeTo in interface MessageFormatter
Parameters:
msgCtx - message from which the Hessian message has to be extracted
format - message format to be written
out - stream to which the message is written
preserve - whether to preserve the indentations
Throws:
AxisFault - in case of a failure in writing the message to the provided stream

getBytes

public byte[] getBytes(MessageContext msgCtxt,
                       OMOutputFormat format)
                throws AxisFault
This method is not supported because of large file handling limitations

Specified by:
getBytes in interface MessageFormatter
Parameters:
msgCtxt - message which contains the Hessian message inside the HessianDataSource
format - message format to be written
Returns:
Hessian binary bytes of the message
Throws:
AxisFault - for any invocation

formatSOAPAction

public String formatSOAPAction(MessageContext messageContext,
                               OMOutputFormat format,
                               String soapAction)
Simply returns the soapAction unchanged.

Specified by:
formatSOAPAction in interface MessageFormatter

getTargetAddress

public URL getTargetAddress(MessageContext messageContext,
                            OMOutputFormat format,
                            URL targetURL)
                     throws AxisFault

Specified by:
getTargetAddress in interface MessageFormatter
Returns:
A templated URL based on the given target URL.
Throws:
AxisFault


Copyright © 2005-2012 Apache Software Foundation. All Rights Reserved.