com.wm.app.b2b.server
Interface ContentHandler


public interface ContentHandler

A ContentHandler will field incoming requests of a particular MIME type. It is responsible for reading input data in whatever format(s) it understands, and formatting output data appropriately. This is irrespective of the request transport (i.e. HTTP, FTP, etc.)


Method Summary
 java.lang.String getContentType()
          Returns the MIME type of this content handler.
 Values getInputValues(java.io.InputStream is, InvokeState state)
          Reads input for service invocation.
 void putOutputValues(java.io.OutputStream os, Values out, InvokeState state)
          Encodes output of service invocation.
 

Method Detail

getInputValues

Values getInputValues(java.io.InputStream is,
                      InvokeState state)
                      throws java.io.IOException
Reads input for service invocation. Turns properly formatted input into an instance of Values suitable for service invocation. Called before service invocation to provide input.

Parameters:
is - the input stream from which to read
state - current invocation state (current user, etc.)
Throws:
java.io.IOException

putOutputValues

void putOutputValues(java.io.OutputStream os,
                     Values out,
                     InvokeState state)
                     throws java.io.IOException
Encodes output of service invocation. Writes output data (including possibly error messages) directly to the output stream.

Parameters:
os - the output stream to which to write
out - output values to encode
state - current invocation state (current user, etc.)
Throws:
java.io.IOException

getContentType

java.lang.String getContentType()
Returns the MIME type of this content handler. Used to identify the handler and write header information.

Returns:
a MIME string (e.g. "text/xml")