|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface AuWriter
Represents a writer that is used to send the output back to the client,
when processing AuRequest
.
To use the writer, open(java.lang.Object, java.lang.Object)
must be called first.
And, close(java.lang.Object, java.lang.Object)
after all responses are written.
AuWriters.setImplementationClass(java.lang.Class)
Method Summary | |
---|---|
void |
close(java.lang.Object request,
java.lang.Object response)
Closes the writer and flush the result to client. |
java.lang.Object |
complete()
Indicates the writing has been completed. |
AuWriter |
open(java.lang.Object request,
java.lang.Object response)
Initializes the writer. |
void |
resend(java.lang.Object prevContent)
Resend the content of the previous request returned by complete() . |
void |
setCompress(boolean compress)
Sets whether to compress the output with GZIP. |
void |
write(AuResponse response)
Generates the specified the response to the output. |
void |
write(java.util.Collection<AuResponse> responses)
Generates a list of responses to the output. |
void |
writeResponseId(int resId)
Generates the response ID to the output. |
Method Detail |
---|
void setCompress(boolean compress)
Default: true.
AuWriter open(java.lang.Object request, java.lang.Object response) throws java.io.IOException
request
- the request (HttpServletRequest if HTTP)response
- the response (HttpServletResponse if HTTP)
java.io.IOException
void close(java.lang.Object request, java.lang.Object response) throws java.io.IOException
request
- the request (HttpServletRequest if HTTP)response
- the response (HttpServletResponse if HTTP)
java.io.IOException
java.lang.Object complete() throws java.io.IOException
close(java.lang.Object, java.lang.Object)
,
if the caller supports the resend mechanism.
The caller usually stores the return value to a desktop by
DesktopCtrl.responseSent(java.lang.String, java.lang.Object)
).
Unlike close(java.lang.Object, java.lang.Object)
, this method must be called
in an activated execution.
Once this method is called, the caller shall not invoke
any other write method. It shall invoke only close(java.lang.Object, java.lang.Object)
to end the writer.
java.io.IOException
void resend(java.lang.Object prevContent) throws java.io.IOException
complete()
.
The content is usually stored to a desktop
by DesktopCtrl.responseSent(java.lang.String, java.lang.Object)
,
and retrieved by DesktopCtrl.getLastResponse(java.lang.String)
.
Once this method is called, the caller shall not invoke
any other write method nor complete()
.
It shall invoke only close(java.lang.Object, java.lang.Object)
to end the writer.
prevContent
- the previous content returned by
close(java.lang.Object, java.lang.Object)
of the previous AuWriter
.
java.lang.IllegalArgumentException
- if prevContent is null.
java.lang.IllegalStateException
- if any of write methods
(such as write(org.zkoss.zk.au.AuResponse)
) is called.
java.io.IOException
void writeResponseId(int resId) throws java.io.IOException
java.io.IOException
DesktopCtrl.getResponseId(boolean)
void write(AuResponse response) throws java.io.IOException
java.io.IOException
void write(java.util.Collection<AuResponse> responses) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |