com.flat502.rox.marshal
Interface RpcMethod

All Known Subinterfaces:
RpcCall, RpcFault, RpcResponse
All Known Implementing Classes:
AbstractRpcCall, AbstractRpcResponse, CgiRpcMethodCall, XmlRpcMethod, XmlRpcMethodCall, XmlRpcMethodFault, XmlRpcMethodResponse

public interface RpcMethod

An interface representing an RPC method that can be marshalled to an OutputStream.

This is the base interface for calls and responses.

See Also:
RpcCall, RpcResponse

Method Summary
 java.lang.String getContentType()
          Called to get the value for the Content-Type HTTP header.
 void marshal(java.io.OutputStream out, java.nio.charset.Charset charSet)
          Marshal the current instance to an OutputStream encoded using the specified character set.
 

Method Detail

marshal

void marshal(java.io.OutputStream out,
             java.nio.charset.Charset charSet)
             throws java.io.IOException,
                    MarshallingException
Marshal the current instance to an OutputStream encoded using the specified character set.

Implementations are free to ignore the character set but only if a character set has been agreed upon in advance by both sides.

Parameters:
out - The OutputStream to marshal this instance to.
charSet - The character set to use when encoding the marshalled form of this instance. When this interface is invoked by an HttpRpcProcessor this is the value that will be sent as part of the Content-Type HTTP header.
Throws:
java.io.IOException - if an error occurs while storing the marshalled form of this instance out this instance.
MarshallingException - if an error occurs while marshalling this instance.

getContentType

java.lang.String getContentType()
Called to get the value for the Content-Type HTTP header.

This is used when constructing requests and responses, and when validating requests and responses.

Returns:
An HTTP Content-Type string description without the charset attribute.