|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.caucho.portal.generic.context.AbstractResponseHandler
public class AbstractResponseHandler
A ResponseHandler that wraps another ResponseHandler. Derived classes override the print() and write() methods to intercept the output. flushBuffer(), reset(), and resetBuffer() DO NOT propagate to the wrapped stream (they do nothing in the implementations for this class)
| Field Summary | |
|---|---|
protected java.io.OutputStream |
_outputStream
|
protected java.io.OutputStream |
_outputStreamOut
|
protected java.io.PrintWriter |
_writer
|
protected java.io.PrintWriter |
_writerOut
|
protected static java.util.logging.Logger |
log
|
| Constructor Summary | |
|---|---|
AbstractResponseHandler()
|
|
AbstractResponseHandler(ResponseHandler successor)
|
|
| Method Summary | |
|---|---|
void |
addProperty(java.lang.String name,
java.lang.String value)
Add a value to a property to be returned to the client. |
protected void |
checkErrorOrFail()
|
void |
finish()
|
void |
flushBuffer()
flushBuffer(), reset(), and resetBuffer() DO NOT propagate to the wrapped stream (they do nothing in the implementations for this class) |
int |
getBufferSize()
|
java.lang.String |
getCharacterEncoding()
Get the character encoding of the writer. |
java.lang.String |
getContentType()
Get the type previously set with setContentType or null if the type has not been set. |
java.lang.Exception |
getErrorCause()
Return an exception if this ResponseHandler has failed. |
java.util.Locale |
getLocale()
|
java.io.OutputStream |
getOutputStream()
|
ResponseHandler |
getSuccessor()
Get the handler that this handler wraps, if any |
protected java.io.OutputStream |
getUnderlyingOutputStream()
|
protected java.io.PrintWriter |
getUnderlyingWriter()
|
java.io.PrintWriter |
getWriter()
Get a writer that sends output to the client of the connection. |
boolean |
isCommitted()
|
boolean |
isError()
|
void |
open(ResponseHandler successor)
|
protected void |
print(char c)
Write a char out to the underlying Writer |
protected void |
print(char[] buf,
int off,
int len)
Write chars out to the underlying Writer |
protected void |
print(java.lang.String str,
int off,
int len)
Write chars out to the underlying Writer |
void |
reset()
flushBuffer(), reset(), and resetBuffer() DO NOT propagate to the wrapped stream (they do nothing in the implementations for this class) |
void |
resetBuffer()
flushBuffer(), reset(), and resetBuffer() DO NOT propagate to the wrapped stream (they do nothing in the implementations for this class) |
void |
setBufferSize(int bufferSize)
|
void |
setCharacterEncoding(java.lang.String enc)
Set the character encoding of the writer. |
void |
setContentType(java.lang.String contentType)
|
protected void |
setError(java.lang.Exception cause)
Set an error with a cause. |
void |
setLocale(java.util.Locale locale)
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Set a property to be returned to the client. |
protected void |
write(byte b)
Write a byte out to the underlying OutputStream |
protected void |
write(byte[] buf,
int off,
int len)
Write bytes out to the underlying OutputStream |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final java.util.logging.Logger log
protected java.io.PrintWriter _writer
protected java.io.OutputStream _outputStream
protected java.io.PrintWriter _writerOut
protected java.io.OutputStream _outputStreamOut
| Constructor Detail |
|---|
public AbstractResponseHandler()
public AbstractResponseHandler(ResponseHandler successor)
| Method Detail |
|---|
public void open(ResponseHandler successor)
public void finish()
throws java.io.IOException
finish in interface ResponseHandlerjava.io.IOExceptionpublic ResponseHandler getSuccessor()
ResponseHandler
getSuccessor in interface ResponseHandler
public void setProperty(java.lang.String name,
java.lang.String value)
ResponseHandler
setProperty in interface ResponseHandlerjavax.portlet.PortletResponse#setProperty
public void addProperty(java.lang.String name,
java.lang.String value)
ResponseHandler
addProperty in interface ResponseHandlerjavax.portlet.PortletResponse#addProperty
public void setCharacterEncoding(java.lang.String enc)
throws java.io.UnsupportedEncodingException
ResponseHandler
setCharacterEncoding in interface ResponseHandlerjava.io.UnsupportedEncodingExceptionpublic java.lang.String getCharacterEncoding()
ResponseHandler
getCharacterEncoding in interface ResponseHandlerpublic void setContentType(java.lang.String contentType)
setContentType in interface ResponseHandlerpublic java.lang.String getContentType()
ResponseHandler
getContentType in interface ResponseHandlerpublic void setLocale(java.util.Locale locale)
setLocale in interface ResponseHandlerpublic java.util.Locale getLocale()
getLocale in interface ResponseHandlerpublic boolean isCommitted()
isCommitted in interface ResponseHandler
public java.io.PrintWriter getWriter()
throws java.io.IOException
ResponseHandler
getWriter in interface ResponseHandlerjava.io.IOExceptionprotected java.io.PrintWriter getUnderlyingWriter()
public java.io.OutputStream getOutputStream()
throws java.io.IOException
getOutputStream in interface ResponseHandlerjava.io.IOExceptionprotected java.io.OutputStream getUnderlyingOutputStream()
protected void setError(java.lang.Exception cause)
public java.lang.Exception getErrorCause()
public boolean isError()
protected void checkErrorOrFail()
throws java.io.IOException
java.io.IOExceptionpublic void setBufferSize(int bufferSize)
setBufferSize in interface ResponseHandlerpublic int getBufferSize()
getBufferSize in interface ResponseHandlerpublic void reset()
reset in interface ResponseHandlerpublic void resetBuffer()
resetBuffer in interface ResponseHandler
public void flushBuffer()
throws java.io.IOException
flushBuffer in interface ResponseHandlerjava.io.IOException
protected void print(char[] buf,
int off,
int len)
throws java.io.IOException
java.io.IOException
protected void print(java.lang.String str,
int off,
int len)
throws java.io.IOException
java.io.IOException
protected void print(char c)
throws java.io.IOException
java.io.IOException
protected void write(byte[] buf,
int off,
int len)
throws java.io.IOException
java.io.IOException
protected void write(byte b)
throws java.io.IOException
java.io.IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||