org.apache.catalina.connector
クラス ResponseBase

java.lang.Object
  |
  +--org.apache.catalina.connector.ResponseBase
すべての実装インタフェース:
Response, javax.servlet.ServletResponse
直系の既知のサブクラス:
HttpResponseBase

public abstract class ResponseBase
extends java.lang.Object
implements Response, javax.servlet.ServletResponse

Convenience base implementation of the Response interface, which can be used for the Response implementation required by most Connectors. Only the connector-specific methods need to be implemented.

バージョン:
$Revision: 1.16.2.6 $ $Date: 2002/02/21 22:13:33 $
作成者:
Craig R. McClanahan, Remy Maucherat

フィールドの概要
protected  boolean appCommitted
          Has this response been committed by the application yet?
protected  byte[] buffer
          The buffer through which all of our output bytes are passed.
protected  int bufferCount
          The number of data bytes currently in the buffer.
protected  boolean committed
          Has this response been committed yet?
protected  Connector connector
          The Connector through which this Response is returned.
protected  int contentCount
          The actual number of bytes written to this Response.
protected  int contentLength
          The content length associated with this Response.
protected  java.lang.String contentType
          The content type associated with this Response.
protected  Context context
          The Context within which this Response is being produced.
protected  java.lang.String encoding
          The character encoding associated with this Response.
protected  boolean error
          Error flag.
protected  ResponseFacade facade
          The facade associated with this response.
protected  boolean included
          Are we currently processing inside a RequestDispatcher.include()?
protected static java.lang.String info
          Descriptive information about this Response implementation.
protected  java.util.Locale locale
          The Locale associated with this Response.
protected  java.io.OutputStream output
          The output stream associated with this Response.
protected  Request request
          The Request with which this Response is associated.
protected static StringManager sm
          The string manager for this package.
protected  javax.servlet.ServletOutputStream stream
          The ServletOutputStream that has been returned by getOutputStream(), if any.
protected  boolean suspended
          Has this response output been suspended?
protected  java.io.PrintWriter writer
          The PrintWriter that has been returned by getWriter(), if any.
 
コンストラクタの概要
ResponseBase()
           
 
メソッドの概要
 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.
 void flushBuffer()
          Flush the buffer and commit this response.
 int getBufferSize()
          Return the actual buffer size used for this Response.
 java.lang.String getCharacterEncoding()
          Return the character encoding used for this Response.
 Connector getConnector()
          Return the Connector through which this Response will be transmitted.
 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.util.Locale getLocale()
          Return the Locale assigned to this response.
 javax.servlet.ServletOutputStream getOutputStream()
          Return the servlet output stream associated with this Response.
 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.
 java.io.PrintWriter getWriter()
          Return the writer associated with this Response.
 boolean isAppCommitted()
          Application commit flag accessor.
 boolean isCommitted()
          Has the output of this response already been committed?
 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 reset()
          Clear any content written to the buffer.
 void resetBuffer()
          Reset the data buffer but not any status or header information.
 void setAppCommitted(boolean appCommitted)
          Set the application commit flag.
 void setBufferSize(int size)
          Set the buffer size to be used for this Response.
 void setConnector(Connector connector)
          Set the Connector through which this Response will be transmitted.
 void setContentLength(int length)
          Set the content length (in bytes) for this Response.
 void setContentType(java.lang.String type)
          Set the content type for this Response.
 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 setLocale(java.util.Locale locale)
          Set the Locale that is appropriate for this response, including setting the appropriate character encoding.
 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.
 void write(byte[] b)
          Write b.length bytes from the specified byte array to our output stream.
 void write(byte[] b, int off, int len)
          Write len bytes from the specified byte array, starting at the specified offset, to our output stream.
 void write(int b)
          Write the specified byte to our output stream, flushing if necessary.
 
クラス java.lang.Object から継承したメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

フィールドの詳細

appCommitted

protected boolean appCommitted
Has this response been committed by the application yet?

buffer

protected byte[] buffer
The buffer through which all of our output bytes are passed.

bufferCount

protected int bufferCount
The number of data bytes currently in the buffer.

committed

protected boolean committed
Has this response been committed yet?

connector

protected Connector connector
The Connector through which this Response is returned.

contentCount

protected int contentCount
The actual number of bytes written to this Response.

contentLength

protected int contentLength
The content length associated with this Response.

contentType

protected java.lang.String contentType
The content type associated with this Response.

context

protected Context context
The Context within which this Response is being produced.

encoding

protected java.lang.String encoding
The character encoding associated with this Response.

facade

protected ResponseFacade facade
The facade associated with this response.

included

protected boolean included
Are we currently processing inside a RequestDispatcher.include()?

info

protected static final java.lang.String info
Descriptive information about this Response implementation.

locale

protected java.util.Locale locale
The Locale associated with this Response.

output

protected java.io.OutputStream output
The output stream associated with this Response.

request

protected Request request
The Request with which this Response is associated.

sm

protected static StringManager sm
The string manager for this package.

stream

protected javax.servlet.ServletOutputStream stream
The ServletOutputStream that has been returned by getOutputStream(), if any.

suspended

protected boolean suspended
Has this response output been suspended?

writer

protected java.io.PrintWriter writer
The PrintWriter that has been returned by getWriter(), if any.

error

protected boolean error
Error flag. True if the response is an error report.
コンストラクタの詳細

ResponseBase

public ResponseBase()
メソッドの詳細

setAppCommitted

public void setAppCommitted(boolean appCommitted)
Set the application commit flag.
定義:
インタフェース Response 内の setAppCommitted
インタフェース org.apache.catalina.Response からコピーされたタグ:
パラメータ:
appCommitted - The new application committed flag value

isAppCommitted

public boolean isAppCommitted()
Application commit flag accessor.
定義:
インタフェース Response 内の isAppCommitted

getConnector

public Connector getConnector()
Return the Connector through which this Response will be transmitted.
定義:
インタフェース Response 内の getConnector

setConnector

public void setConnector(Connector connector)
Set the Connector through which this Response will be transmitted.
定義:
インタフェース Response 内の setConnector
パラメータ:
connector - The new connector

getContentCount

public int getContentCount()
Return the number of bytes actually written to the output stream.
定義:
インタフェース Response 内の getContentCount

getContext

public Context getContext()
Return the Context with which this Response is associated.
定義:
インタフェース Response 内の getContext

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.
定義:
インタフェース Response 内の setContext
パラメータ:
context - The associated Context

getIncluded

public boolean getIncluded()
Return the "processing inside an include" flag.
定義:
インタフェース Response 内の getIncluded

setIncluded

public void setIncluded(boolean included)
Set the "processing inside an include" flag.
定義:
インタフェース Response 内の setIncluded
パラメータ:
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>.
定義:
インタフェース Response 内の getInfo

getRequest

public Request getRequest()
Return the Request with which this Response is associated.
定義:
インタフェース Response 内の getRequest

setRequest

public void setRequest(Request request)
Set the Request with which this Response is associated.
定義:
インタフェース Response 内の setRequest
パラメータ:
request - The new associated request

getResponse

public javax.servlet.ServletResponse getResponse()
Return the ServletResponse for which this object is the facade.
定義:
インタフェース Response 内の getResponse

getStream

public java.io.OutputStream getStream()
Return the output stream associated with this Response.
定義:
インタフェース Response 内の getStream

setStream

public void setStream(java.io.OutputStream stream)
Set the output stream associated with this Response.
定義:
インタフェース Response 内の setStream
パラメータ:
stream - The new output stream

setSuspended

public void setSuspended(boolean suspended)
Set the suspended flag.
定義:
インタフェース Response 内の setSuspended
インタフェース org.apache.catalina.Response からコピーされたタグ:
パラメータ:
suspended - The new suspended flag value

isSuspended

public boolean isSuspended()
Suspended flag accessor.
定義:
インタフェース Response 内の isSuspended

setError

public void setError()
Set the error flag.
定義:
インタフェース Response 内の setError

isError

public boolean isError()
Error flag accessor.
定義:
インタフェース Response 内の isError

createOutputStream

public javax.servlet.ServletOutputStream createOutputStream()
                                                     throws java.io.IOException
Create and return a ServletOutputStream to write the content associated with this Response.
定義:
インタフェース Response 内の createOutputStream
例外:
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.
定義:
インタフェース Response 内の finishResponse
例外:
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.
定義:
インタフェース Response 内の getContentLength

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.
定義:
インタフェース Response 内の getContentType

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.
定義:
インタフェース Response 内の getReporter
インタフェース org.apache.catalina.Response からコピーされたタグ:
戻り値:
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.
定義:
インタフェース Response 内の recycle

write

public void write(int b)
           throws java.io.IOException
Write the specified byte to our output stream, flushing if necessary.
パラメータ:
b - The byte to be written
例外:
java.io.IOException - if an input/output error occurs

write

public void write(byte[] b)
           throws java.io.IOException
Write b.length bytes from the specified byte array to our output stream. Flush the output stream as necessary.
パラメータ:
b - The byte array to be written
例外:
java.io.IOException - if an input/output error occurs

write

public void write(byte[] b,
                  int off,
                  int len)
           throws java.io.IOException
Write len bytes from the specified byte array, starting at the specified offset, to our output stream. Flush the output stream as necessary.
パラメータ:
b - The byte array containing the bytes to be written
off - Zero-relative starting offset of the bytes to be written
len - The number of bytes to be written
例外:
java.io.IOException - if an input/output error occurs

flushBuffer

public void flushBuffer()
                 throws java.io.IOException
Flush the buffer and commit this response.
定義:
インタフェース javax.servlet.ServletResponse 内の flushBuffer
例外:
java.io.IOException - if an input/output error occurs

getBufferSize

public int getBufferSize()
Return the actual buffer size used for this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の getBufferSize

getCharacterEncoding

public java.lang.String getCharacterEncoding()
Return the character encoding used for this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の getCharacterEncoding

getOutputStream

public javax.servlet.ServletOutputStream getOutputStream()
                                                  throws java.io.IOException
Return the servlet output stream associated with this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の getOutputStream
例外:
java.lang.IllegalStateException - if getWriter has already been called for this response
java.io.IOException - if an input/output error occurs

getLocale

public java.util.Locale getLocale()
Return the Locale assigned to this response.
定義:
インタフェース javax.servlet.ServletResponse 内の getLocale

getWriter

public java.io.PrintWriter getWriter()
                              throws java.io.IOException
Return the writer associated with this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の getWriter
例外:
java.lang.IllegalStateException - if getOutputStream has already been called for this response
java.io.IOException - if an input/output error occurs

isCommitted

public boolean isCommitted()
Has the output of this response already been committed?
定義:
インタフェース javax.servlet.ServletResponse 内の isCommitted

reset

public void reset()
Clear any content written to the buffer.
定義:
インタフェース javax.servlet.ServletResponse 内の reset
例外:
java.lang.IllegalStateException - if this response has already been committed

resetBuffer

public void resetBuffer()
Reset the data buffer but not any status or header information.
定義:
インタフェース Response 内の resetBuffer
例外:
java.lang.IllegalStateException - if the response has already been committed

setBufferSize

public void setBufferSize(int size)
Set the buffer size to be used for this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の setBufferSize
パラメータ:
size - The new buffer size
例外:
java.lang.IllegalStateException - if this method is called after output has been committed for this response

setContentLength

public void setContentLength(int length)
Set the content length (in bytes) for this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の setContentLength
パラメータ:
length - The new content length

setContentType

public void setContentType(java.lang.String type)
Set the content type for this Response.
定義:
インタフェース javax.servlet.ServletResponse 内の setContentType
パラメータ:
type - The new content type

setLocale

public void setLocale(java.util.Locale locale)
Set the Locale that is appropriate for this response, including setting the appropriate character encoding.
定義:
インタフェース javax.servlet.ServletResponse 内の setLocale
パラメータ:
locale - The new locale


Copyright ? 2000-2001 Apache Software Foundation. All Rights Reserved.