org.zkoss.zkmax.au.http
Class SmartAuWriter

java.lang.Object
  extended by org.zkoss.zk.au.http.HttpAuWriter
      extended by org.zkoss.zkmax.au.http.SmartAuWriter
All Implemented Interfaces:
AuWriter

public class SmartAuWriter
extends HttpAuWriter

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).

Available in ZK EE

Since:
3.0.1
Author:
tomyeh

Constructor Summary
SmartAuWriter()
           
 
Method Summary
 void close(java.lang.Object request, java.lang.Object response)
          Closes the connection.
protected  ScalableTimer newTimer()
          Creates an instance of ScalableTimer.
 AuWriter open(java.lang.Object request, java.lang.Object response, int timeout)
          Opens the connection.
 
Methods inherited from class org.zkoss.zk.au.http.HttpAuWriter
getResult, isCompress, setCompress, write, write, writeResponseId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SmartAuWriter

public SmartAuWriter()
Method Detail

newTimer

protected ScalableTimer newTimer()
Creates an instance of 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.

Since:
3.0.4

open

public AuWriter open(java.lang.Object request,
                     java.lang.Object response,
                     int timeout)
              throws java.io.IOException
Opens the connection. It starts a timer and generate some output to client first if the processing take more than the time specified in the timeout argument.

Specified by:
open in interface AuWriter
Overrides:
open in class HttpAuWriter
Parameters:
request - 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.
Returns:
this object
Throws:
java.io.IOException

close

public void close(java.lang.Object request,
                  java.lang.Object response)
           throws java.io.IOException
Description copied from class: HttpAuWriter
Closes the connection.

Specified by:
close in interface AuWriter
Overrides:
close in class HttpAuWriter
Parameters:
request - the request (HttpServletRequest if HTTP)
response - the response (HttpServletResponse if HTTP)
Throws:
java.io.IOException


Copyright © 2005-2009 Potix Corporation. All Rights Reserved. SourceForge.net Logo