m.c.m.proxyma.resource
Class ProxymaServletResponse

java.lang.Object
  extended by m.c.m.proxyma.resource.ProxymaResponse
      extended by m.c.m.proxyma.resource.ProxymaServletResponse

public class ProxymaServletResponse
extends ProxymaResponse

This class implements a response wrapper. It adapts servlet container response to be managed by Proxyma Serializers. it is the only class that "knows" how to send the data back to the client. Through this class Proxyma can transparently act as a standard Servlet.

NOTE: this software is released under GPL License. See the LICENSE of this distribution for more informations.

Version:
$Id: ProxymaServletResponse.java 159 2010-06-27 20:41:25Z marcolinuz $
Author:
Marco Casavecchia Morganti (marcolinuz) [marcolinuz-at-gmail.com]

Constructor Summary
ProxymaServletResponse(javax.servlet.http.HttpServletResponse aResponse, ProxymaContext theContext)
          Default constructor for this class.
 
Method Summary
 int sendDataToClient()
          This method uses the wrapped HttpServletResponse to send the whole response data (headers, status, cookies and binary data) to the Client.
 
Methods inherited from class m.c.m.proxyma.resource.ProxymaResponse
getResponseData, hasBeenSent, sendingData, setResponseData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProxymaServletResponse

public ProxymaServletResponse(javax.servlet.http.HttpServletResponse aResponse,
                              ProxymaContext theContext)
                       throws org.apache.commons.lang.NullArgumentException
Default constructor for this class. It thakes the original servlet response to wrap as parameter.

Parameters:
aResponse - the HttpServletResponse to wrap
Throws:
org.apache.commons.lang.NullArgumentException
Method Detail

sendDataToClient

public int sendDataToClient()
                     throws java.lang.IllegalStateException,
                            java.io.IOException
This method uses the wrapped HttpServletResponse to send the whole response data (headers, status, cookies and binary data) to the Client.
Note: it performs the suggested operations specified in the ProxymaRequest documentation

Specified by:
sendDataToClient in class ProxymaResponse
Returns:
the status code of the response
Throws:
java.lang.IllegalStateException - if the data as been already sent to the client.
java.io.IOException
See Also:
ProxymaRequest


Copyright © 2010. All Rights Reserved.