|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.zkoss.zk.au.http.HttpAuWriter
org.zkoss.zkmax.au.http.SmartAuWriter
public class SmartAuWriter
A smart AU writer that will generate some output to client first if
the processing takes more than the time specified in the timeout argument
of open(java.lang.Object, java.lang.Object, int).
In additions, it compressed the last response in GZIP format to minimize the memory use.
Available in ZK EE
| Constructor Summary | |
|---|---|
SmartAuWriter()
|
|
| Method Summary | |
|---|---|
void |
close(java.lang.Object request,
java.lang.Object response)
Closes the writer and flush the result to client. |
protected ScalableTimer |
newTimer()
Creates an instance of ScalableTimer. |
AuWriter |
open(java.lang.Object request,
java.lang.Object response,
int timeout)
Opens the connection. |
protected byte[] |
restore(java.lang.Object data)
Called to decode the last response for repeated request before retrieving. |
protected java.lang.Object |
save(byte[] data)
Called to encode the last response for repeated request before storing. |
| Methods inherited from class org.zkoss.zk.au.http.HttpAuWriter |
|---|
complete, flush, isCompress, resend, setCompress, write, write, writeResponseId |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SmartAuWriter()
| Method Detail |
|---|
protected ScalableTimer newTimer()
ScalableTimer.
By default, it creates a scalable timer that will use at most 50 real timers (i.e., new ScalableTimer(50, 25)). If you want to change it, you can override this method.
public AuWriter open(java.lang.Object request,
java.lang.Object response,
int timeout)
throws java.io.IOException
open in interface AuWriteropen in class HttpAuWriterrequest - the request (HttpServletRequest if HTTP)response - the response (HttpServletResponse if HTTP)timeout - the elapsed time (milliseconds) before sending
a whitespace to the client to indicate the connection is alive.
Ignored if non-positive, or the implementation doesn't support
this feature.
java.io.IOException
public void close(java.lang.Object request,
java.lang.Object response)
throws java.io.IOException
AuWriter
close in interface AuWriterclose in class HttpAuWriterrequest - the request (HttpServletRequest if HTTP)response - the response (HttpServletResponse if HTTP)
java.io.IOExceptionprotected java.lang.Object save(byte[] data)
HttpAuWriterDefault: does nothing but return the input argument, data. The derived class might override this method to compress it.
save in class HttpAuWriterHttpAuWriter.restore(java.lang.Object)protected byte[] restore(java.lang.Object data)
HttpAuWriterDefault: does nothing but return the input argument, data. The derived class might override this method to uncompress it.
restore in class HttpAuWriterdata - the data returned by HttpAuWriter.save(byte[])
HttpAuWriter.save(byte[]).
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||