Package org.apache.axis2.format
Class MessageFormatterExAdapter
- java.lang.Object
-
- org.apache.axis2.format.MessageFormatterExAdapter
-
- All Implemented Interfaces:
MessageFormatterEx,MessageFormatter
public class MessageFormatterExAdapter extends Object implements MessageFormatterEx
Adapter to add theMessageFormatterExinterface to an existingMessageFormatter. It implements theMessageFormatterEx.getDataSource(MessageContext, OMOutputFormat, String)method usingMessageFormatter.writeTo(MessageContext, OMOutputFormat, OutputStream, boolean)andMessageFormatter.getContentType(MessageContext, OMOutputFormat, String).
-
-
Constructor Summary
Constructors Constructor Description MessageFormatterExAdapter(MessageFormatter messageFormatter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringformatSOAPAction(MessageContext messageContext, OMOutputFormat format, String soapAction)StringgetContentType(MessageContext messageContext, OMOutputFormat format, String soapAction)Different message formats can set their own content types Eg: JSONFormatter can set the content type as application/jsonDataSourcegetDataSource(MessageContext messageContext, OMOutputFormat format, String soapAction)Get the formatted message as aDataSourceobject.URLgetTargetAddress(MessageContext messageContext, OMOutputFormat format, URL targetURL)Some message formats may want to alter the target url.voidwriteTo(MessageContext messageContext, OMOutputFormat format, OutputStream outputStream, boolean preserve)To support deffered writing transports as in http chunking..
-
-
-
Constructor Detail
-
MessageFormatterExAdapter
public MessageFormatterExAdapter(MessageFormatter messageFormatter)
-
-
Method Detail
-
getDataSource
public DataSource getDataSource(MessageContext messageContext, OMOutputFormat format, String soapAction) throws AxisFault
Description copied from interface:MessageFormatterExGet the formatted message as aDataSourceobject.- Specified by:
getDataSourcein interfaceMessageFormatterEx- Returns:
- Throws:
AxisFault
-
formatSOAPAction
public String formatSOAPAction(MessageContext messageContext, OMOutputFormat format, String soapAction)
- Specified by:
formatSOAPActionin interfaceMessageFormatter- Returns:
- this only if you want set a transport header for SOAP Action
-
getContentType
public String getContentType(MessageContext messageContext, OMOutputFormat format, String soapAction)
Description copied from interface:MessageFormatterDifferent message formats can set their own content types Eg: JSONFormatter can set the content type as application/json- Specified by:
getContentTypein interfaceMessageFormatter
-
getTargetAddress
public URL getTargetAddress(MessageContext messageContext, OMOutputFormat format, URL targetURL) throws AxisFault
Description copied from interface:MessageFormatterSome message formats may want to alter the target url.- Specified by:
getTargetAddressin interfaceMessageFormatter- Returns:
- the target URL
- Throws:
AxisFault
-
writeTo
public void writeTo(MessageContext messageContext, OMOutputFormat format, OutputStream outputStream, boolean preserve) throws AxisFault
Description copied from interface:MessageFormatterTo support deffered writing transports as in http chunking.. Axis2 was doing this for some time.. Preserve flag can be used to preserve the envelope for later use. This is usefull when implementing authentication machnisms like NTLM.- Specified by:
writeToin interfaceMessageFormatterpreserve- : do not consume the OM when this is set..- Throws:
AxisFault
-
-