com.caucho.jsf.context
Class JspResponseWrapper

java.lang.Object
  extended by com.caucho.server.http.AbstractCauchoResponse
      extended by com.caucho.server.http.CauchoResponseWrapper
          extended by com.caucho.jsf.context.JspResponseWrapper
All Implemented Interfaces:
CauchoResponse, HttpServletResponse, ServletResponse

public class JspResponseWrapper
extends CauchoResponseWrapper


Field Summary
 
Fields inherited from interface javax.servlet.http.HttpServletResponse
SC_ACCEPTED, SC_BAD_GATEWAY, SC_BAD_REQUEST, SC_CONFLICT, SC_CONTINUE, SC_CREATED, SC_EXPECTATION_FAILED, SC_FORBIDDEN, SC_FOUND, SC_GATEWAY_TIMEOUT, SC_GONE, SC_HTTP_VERSION_NOT_SUPPORTED, SC_INTERNAL_SERVER_ERROR, SC_LENGTH_REQUIRED, SC_METHOD_NOT_ALLOWED, SC_MOVED_PERMANENTLY, SC_MOVED_TEMPORARILY, SC_MULTIPLE_CHOICES, SC_NO_CONTENT, SC_NON_AUTHORITATIVE_INFORMATION, SC_NOT_ACCEPTABLE, SC_NOT_FOUND, SC_NOT_IMPLEMENTED, SC_NOT_MODIFIED, SC_OK, SC_PARTIAL_CONTENT, SC_PAYMENT_REQUIRED, SC_PRECONDITION_FAILED, SC_PROXY_AUTHENTICATION_REQUIRED, SC_REQUEST_ENTITY_TOO_LARGE, SC_REQUEST_TIMEOUT, SC_REQUEST_URI_TOO_LONG, SC_REQUESTED_RANGE_NOT_SATISFIABLE, SC_RESET_CONTENT, SC_SEE_OTHER, SC_SERVICE_UNAVAILABLE, SC_SWITCHING_PROTOCOLS, SC_TEMPORARY_REDIRECT, SC_UNAUTHORIZED, SC_UNSUPPORTED_MEDIA_TYPE, SC_USE_PROXY
 
Constructor Summary
JspResponseWrapper()
           
 
Method Summary
 void clearBuffer()
           
 void close()
          complete the response.
 java.lang.String completeJsf()
           
 boolean disableHeaders(boolean disable)
           
 void flushBuffer()
          Flushes the buffer to the client.
 void flushResponse()
           
 FlushBuffer getFlushBuffer()
          Gets the flush buffer
 boolean getForbidForward()
          Returns true if RequestDispatcher.forward() is disallowed on this stream.
 java.lang.String getHeader(java.lang.String key)
          Retuns value of header with a given name
 java.util.Collection<java.lang.String> getHeaderNames()
          Returns an Iterable for header names set via HttpServletResponse.setHeader(java.lang.String, java.lang.String), HttpServletResponse.addHeader(java.lang.String, java.lang.String), HttpServletResponse.setDateHeader(java.lang.String, long), HttpServletResponse.addDateHeader(java.lang.String, long), HttpServletResponse.setIntHeader(java.lang.String, int), or HttpServletResponse.addIntHeader(java.lang.String, int), respectively.
 java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
          Returns an Iterable for header values with a given name
 ServletOutputStream getOutputStream()
          Returns the servlet output stream.
 int getRemaining()
           
 AbstractResponseStream getResponseStream()
          Gets the response stream.
 int getStatus()
          Returns the current status code of this response
 java.lang.String getStatusMessage()
           
protected  java.io.OutputStream getStream()
          Returns the output stream for this wrapper.
 java.io.PrintWriter getWriter()
          Returns the print writer.
 boolean hasError()
          Returns true if we're processing an error.
 void init(HttpServletResponse response)
          Initialize the response.
 boolean isCauchoResponseStream()
          Returns true for a caucho response stream.
 void killCache()
          Kills the cache for an error.
 void resetBuffer()
          Resets the output stream, clearing headers and the output buffer.
 void setFlushBuffer(FlushBuffer flushBuffer)
          Sets the flush buffer
 void setForbidForward(boolean forbid)
          When set to true, RequestDispatcher.forward() is disallowed on this stream.
 void setHasError(boolean hasError)
          Set to true while processing an error.
 void setLocale(java.util.Locale locale)
          Sets the output locale.
 void setNoCache(boolean isPrivate)
           
 void setPrivateCache(boolean isPrivate)
           
 void setResponseStream(AbstractResponseStream stream)
          Sets the ResponseStream
 void setSessionId(java.lang.String id)
           
 
Methods inherited from class com.caucho.server.http.CauchoResponseWrapper
addCookie, addDateHeader, addFooter, addHeader, addIntHeader, completeCache, containsHeader, encodeRedirectUrl, encodeRedirectURL, encodeUrl, encodeURL, getAbstractHttpResponse, getBufferSize, getCauchoResponse, getCharacterEncoding, getContentType, getLocale, getRequest, getResponse, isCommitted, isForwardEnclosed, isNoCacheUnlessVary, reset, sendError, sendError, sendInternalError, sendRedirect, setBufferSize, setCacheInvocation, setCharacterEncoding, setContentLength, setContentType, setDateHeader, setFooter, setForwardEnclosed, setHeader, setIntHeader, setMatchCacheEntry, setResponse, setStatus, setStatus, toString
 
Methods inherited from class com.caucho.server.http.AbstractCauchoResponse
writeHeaders
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.caucho.server.http.CauchoResponse
writeHeaders
 

Constructor Detail

JspResponseWrapper

public JspResponseWrapper()
Method Detail

init

public void init(HttpServletResponse response)
Initialize the response.


setResponseStream

public void setResponseStream(AbstractResponseStream stream)
Sets the ResponseStream

Specified by:
setResponseStream in interface CauchoResponse
Overrides:
setResponseStream in class CauchoResponseWrapper

getResponseStream

public AbstractResponseStream getResponseStream()
Gets the response stream.

Specified by:
getResponseStream in interface CauchoResponse
Overrides:
getResponseStream in class CauchoResponseWrapper

isCauchoResponseStream

public boolean isCauchoResponseStream()
Returns true for a caucho response stream.

Specified by:
isCauchoResponseStream in interface CauchoResponse
Overrides:
isCauchoResponseStream in class CauchoResponseWrapper

getOutputStream

public ServletOutputStream getOutputStream()
                                    throws java.io.IOException
Returns the servlet output stream.

Specified by:
getOutputStream in interface ServletResponse
Overrides:
getOutputStream in class CauchoResponseWrapper
Throws:
java.io.IOException

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Returns the print writer.

Specified by:
getWriter in interface ServletResponse
Overrides:
getWriter in class CauchoResponseWrapper
Throws:
java.io.IOException

getStream

protected java.io.OutputStream getStream()
                                  throws java.io.IOException
Returns the output stream for this wrapper.

Throws:
java.io.IOException

setFlushBuffer

public void setFlushBuffer(FlushBuffer flushBuffer)
Sets the flush buffer


getFlushBuffer

public FlushBuffer getFlushBuffer()
Gets the flush buffer


flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Description copied from interface: ServletResponse
Flushes the buffer to the client.

Specified by:
flushBuffer in interface ServletResponse
Overrides:
flushBuffer in class CauchoResponseWrapper
Throws:
java.io.IOException

resetBuffer

public void resetBuffer()
Description copied from interface: ServletResponse
Resets the output stream, clearing headers and the output buffer. Calling reset() after data has been committed is illegal.

Specified by:
resetBuffer in interface ServletResponse
Overrides:
resetBuffer in class CauchoResponseWrapper

clearBuffer

public void clearBuffer()

setLocale

public void setLocale(java.util.Locale locale)
Description copied from interface: ServletResponse
Sets the output locale. The response will set the character encoding based on the locale. For example, setting the "kr" locale will set the character encoding to "EUC_KR".

Specified by:
setLocale in interface ServletResponse
Overrides:
setLocale in class CauchoResponseWrapper

getHeader

public java.lang.String getHeader(java.lang.String key)
Description copied from interface: HttpServletResponse
Retuns value of header with a given name

Specified by:
getHeader in interface CauchoResponse
Specified by:
getHeader in interface HttpServletResponse
Overrides:
getHeader in class CauchoResponseWrapper
Returns:

disableHeaders

public boolean disableHeaders(boolean disable)

getRemaining

public int getRemaining()

setForbidForward

public void setForbidForward(boolean forbid)
When set to true, RequestDispatcher.forward() is disallowed on this stream.

Specified by:
setForbidForward in interface CauchoResponse
Overrides:
setForbidForward in class CauchoResponseWrapper

getForbidForward

public boolean getForbidForward()
Returns true if RequestDispatcher.forward() is disallowed on this stream.

Specified by:
getForbidForward in interface CauchoResponse
Overrides:
getForbidForward in class CauchoResponseWrapper

setHasError

public void setHasError(boolean hasError)
Set to true while processing an error.

Specified by:
setHasError in interface CauchoResponse
Overrides:
setHasError in class CauchoResponseWrapper

getStatusMessage

public java.lang.String getStatusMessage()
Specified by:
getStatusMessage in interface CauchoResponse
Overrides:
getStatusMessage in class CauchoResponseWrapper

hasError

public boolean hasError()
Returns true if we're processing an error.

Specified by:
hasError in interface CauchoResponse
Overrides:
hasError in class CauchoResponseWrapper

killCache

public void killCache()
Kills the cache for an error.

Specified by:
killCache in interface CauchoResponse
Overrides:
killCache in class CauchoResponseWrapper

setSessionId

public void setSessionId(java.lang.String id)
Specified by:
setSessionId in interface CauchoResponse
Overrides:
setSessionId in class CauchoResponseWrapper

setPrivateCache

public void setPrivateCache(boolean isPrivate)
Specified by:
setPrivateCache in interface CauchoResponse
Overrides:
setPrivateCache in class CauchoResponseWrapper

setNoCache

public void setNoCache(boolean isPrivate)
Specified by:
setNoCache in interface CauchoResponse
Overrides:
setNoCache in class CauchoResponseWrapper

getStatus

public int getStatus()
Description copied from interface: HttpServletResponse
Returns the current status code of this response

Specified by:
getStatus in interface HttpServletResponse
Overrides:
getStatus in class CauchoResponseWrapper
Returns:

getHeaders

public java.util.Collection<java.lang.String> getHeaders(java.lang.String name)
Description copied from interface: HttpServletResponse
Returns an Iterable for header values with a given name

Specified by:
getHeaders in interface HttpServletResponse
Overrides:
getHeaders in class CauchoResponseWrapper
Returns:

getHeaderNames

public java.util.Collection<java.lang.String> getHeaderNames()
Description copied from interface: HttpServletResponse
Returns an Iterable for header names set via HttpServletResponse.setHeader(java.lang.String, java.lang.String), HttpServletResponse.addHeader(java.lang.String, java.lang.String), HttpServletResponse.setDateHeader(java.lang.String, long), HttpServletResponse.addDateHeader(java.lang.String, long), HttpServletResponse.setIntHeader(java.lang.String, int), or HttpServletResponse.addIntHeader(java.lang.String, int), respectively.

Specified by:
getHeaderNames in interface HttpServletResponse
Overrides:
getHeaderNames in class CauchoResponseWrapper
Returns:

close

public void close()
           throws java.io.IOException
complete the response.

Specified by:
close in interface CauchoResponse
Overrides:
close in class CauchoResponseWrapper
Throws:
java.io.IOException

flushResponse

public void flushResponse()
                   throws java.io.IOException
Throws:
java.io.IOException

completeJsf

public java.lang.String completeJsf()
                             throws java.io.IOException
Throws:
java.io.IOException