org.apache.catalina
Interface Response

All Known Subinterfaces:
HttpResponse
All Known Implementing Classes:
HttpResponseBase, HttpResponseWrapper, ResponseBase, ResponseWrapper

public interface Response

A Response is the Catalina-internal facade for a ServletResponse that is to be produced, based on the processing of a corresponding Request.

Version:
$Revision: 1.8 $ $Date: 2004/08/26 22:05:53 $
Author:
Craig R. McClanahan

Method Summary
 javax.servlet.ServletOutputStream createOutputStream()
          Create and return a ServletOutputStream to write the content associated with this Response.
 void finishResponse()
          Perform whatever actions are required to flush and close the output stream or writer, in a single operation.
 Connector getConnector()
          Return the Connector through which this Response is returned.
 int getContentCount()
          Return the number of bytes actually written to the output stream.
 int getContentLength()
          Return the content length that was set or calculated for this Response.
 java.lang.String getContentType()
          Return the content type that was set or calculated for this response, or null if no content type was set.
 Context getContext()
          Return the Context with which this Response is associated.
 boolean getIncluded()
          Return the "processing inside an include" flag.
 java.lang.String getInfo()
          Return descriptive information about this Response implementation and the corresponding version number, in the format <description>/<version>.
 java.io.PrintWriter getReporter()
          Return a PrintWriter that can be used to render error messages, regardless of whether a stream or writer has already been acquired.
 Request getRequest()
          Return the Request with which this Response is associated.
 javax.servlet.ServletResponse getResponse()
          Return the ServletResponse for which this object is the facade.
 java.io.OutputStream getStream()
          Return the output stream associated with this Response.
 boolean isAppCommitted()
          Application commit flag accessor.
 boolean isError()
          Error flag accessor.
 boolean isSuspended()
          Suspended flag accessor.
 void recycle()
          Release all object references, and initialize instance variables, in preparation for reuse of this object.
 void resetBuffer()
          Reset the data buffer but not any status or header information.
 void sendAcknowledgement()
          Send an acknowledgment of a request.
 void setAppCommitted(boolean appCommitted)
          Set the application commit flag.
 void setConnector(Connector connector)
          Set the Connector through which this Response is returned.
 void setContext(Context context)
          Set the Context with which this Response is associated.
 void setError()
          Set the error flag.
 void setIncluded(boolean included)
          Set the "processing inside an include" flag.
 void setRequest(Request request)
          Set the Request with which this Response is associated.
 void setStream(java.io.OutputStream stream)
          Set the output stream associated with this Response.
 void setSuspended(boolean suspended)
          Set the suspended flag.
 

Method Detail

getConnector

public Connector getConnector()
Return the Connector through which this Response is returned.


setConnector

public void setConnector(Connector connector)
Set the Connector through which this Response is returned.

Parameters:
connector - The new connector

getContentCount

public int getContentCount()
Return the number of bytes actually written to the output stream.


getContext

public Context getContext()
Return the Context with which this Response is associated.


setContext

public void setContext(Context context)
Set the Context with which this Response is associated. This should be called as soon as the appropriate Context is identified.

Parameters:
context - The associated Context

setAppCommitted

public void setAppCommitted(boolean appCommitted)
Set the application commit flag.

Parameters:
appCommitted - The new application committed flag value

isAppCommitted

public boolean isAppCommitted()
Application commit flag accessor.


getIncluded

public boolean getIncluded()
Return the "processing inside an include" flag.


setIncluded

public void setIncluded(boolean included)
Set the "processing inside an include" flag.

Parameters:
included - true if we are currently inside a RequestDispatcher.include(), else false

getInfo

public java.lang.String getInfo()
Return descriptive information about this Response implementation and the corresponding version number, in the format <description>/<version>.


getRequest

public Request getRequest()
Return the Request with which this Response is associated.


setRequest

public void setRequest(Request request)
Set the Request with which this Response is associated.

Parameters:
request - The new associated request

getResponse

public javax.servlet.ServletResponse getResponse()
Return the ServletResponse for which this object is the facade.


getStream

public java.io.OutputStream getStream()
Return the output stream associated with this Response.


setStream

public void setStream(java.io.OutputStream stream)
Set the output stream associated with this Response.

Parameters:
stream - The new output stream

setSuspended

public void setSuspended(boolean suspended)
Set the suspended flag.

Parameters:
suspended - The new suspended flag value

isSuspended

public boolean isSuspended()
Suspended flag accessor.


setError

public void setError()
Set the error flag.


isError

public boolean isError()
Error flag accessor.


createOutputStream

public javax.servlet.ServletOutputStream createOutputStream()
                                                     throws java.io.IOException
Create and return a ServletOutputStream to write the content associated with this Response.

Throws:
java.io.IOException - if an input/output error occurs

finishResponse

public void finishResponse()
                    throws java.io.IOException
Perform whatever actions are required to flush and close the output stream or writer, in a single operation.

Throws:
java.io.IOException - if an input/output error occurs

getContentLength

public int getContentLength()
Return the content length that was set or calculated for this Response.


getContentType

public java.lang.String getContentType()
Return the content type that was set or calculated for this response, or null if no content type was set.


getReporter

public java.io.PrintWriter getReporter()
Return a PrintWriter that can be used to render error messages, regardless of whether a stream or writer has already been acquired.

Returns:
Writer which can be used for error reports. If the response is not an error report returned using sendError or triggered by an unexpected exception thrown during the servlet processing (and only in that case), null will be returned if the response stream has already been used.

recycle

public void recycle()
Release all object references, and initialize instance variables, in preparation for reuse of this object.


resetBuffer

public void resetBuffer()
Reset the data buffer but not any status or header information.


sendAcknowledgement

public void sendAcknowledgement()
                         throws java.io.IOException
Send an acknowledgment of a request.

Throws:
java.io.IOException - if an input/output error occurs


Copyright 2000-2002 Apache Software Foundation. All Rights Reserved.