public abstract class AbstractWebResponse extends java.lang.Object implements WebResponse
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.atomic.AtomicBoolean |
closed |
protected javax.servlet.ServletOutputStream |
out |
protected java.util.HashMap<java.lang.String,java.lang.Object> |
properties
Custom properties (for inter-middleware communication).
|
protected javax.servlet.http.HttpServletResponse |
rsp |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractWebResponse(javax.servlet.http.HttpServletResponse rsp) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
end()
Completes the synchronous operation that was started on the request.
|
java.lang.String |
getHeader(java.lang.String name)
Returns the value of the specified response header as a String.
|
java.lang.Object |
getInternalObject()
Returns the internal object of this WebResponse.
|
java.lang.Object |
getProperty(java.lang.String name)
Returns the value to which the specified "name" is mapped, or null if
this WebResponse contains no mapping for the "name".
|
int |
getStatus()
Gets the current status code of this response.
|
void |
send(byte[] bytes)
Writes b.length bytes of body from the specified byte array to the output
stream.
|
void |
setHeader(java.lang.String name,
java.lang.String value)
Sets a response header with the given name and value.
|
void |
setProperty(java.lang.String name,
java.lang.Object value)
Associates the specified value with the specified "name" in this
WebResponse.
|
void |
setStatus(int code)
Sets the status code for this response.
|
protected final javax.servlet.http.HttpServletResponse rsp
protected final javax.servlet.ServletOutputStream out
protected final java.util.concurrent.atomic.AtomicBoolean closed
protected java.util.HashMap<java.lang.String,java.lang.Object> properties
protected AbstractWebResponse(javax.servlet.http.HttpServletResponse rsp)
throws java.io.IOException
java.io.IOExceptionpublic void setStatus(int code)
setStatus in interface WebResponsecode - the status codepublic int getStatus()
getStatus in interface WebResponsepublic void setHeader(java.lang.String name,
java.lang.String value)
setHeader in interface WebResponsename - the name of the headervalue - the header value If it contains octet string, it should be
encoded according to RFC 2047public java.lang.String getHeader(java.lang.String name)
getHeader in interface WebResponsename - name a String specifying the header namepublic void send(byte[] bytes)
throws java.io.IOException
send in interface WebResponsebytes - the datajava.io.IOException - if an I/O error occurspublic boolean end()
end in interface WebResponsepublic void setProperty(java.lang.String name,
java.lang.Object value)
setProperty in interface WebResponsename - a "name" with which the specified value is to be associatedvalue - value to be associated with the specified "name"public java.lang.Object getProperty(java.lang.String name)
getProperty in interface WebResponsename - the "name" whose associated value is to be returnedpublic java.lang.Object getInternalObject()
getInternalObject in interface WebResponse