org.zkoss.zk.au.http
Class HttpAuWriter

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

public class HttpAuWriter
extends java.lang.Object
implements AuWriter

The writer used to write the output back to the client.

Since:
3.0.1
Author:
tomyeh

Constructor Summary
HttpAuWriter()
           
 
Method Summary
 void close(java.lang.Object request, java.lang.Object response)
          Closes the connection.
protected  java.lang.String getResult()
          Returns the result of responses that will be sent to client (never null).
 boolean isCompress()
          Returns whether to compress the output.
 AuWriter open(java.lang.Object request, java.lang.Object response, int timeout)
          Opens the connection.
 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 responses)
          Generates a list of responses to the output.
 void writeResponseId(int resId)
          Generates the response ID to the output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpAuWriter

public HttpAuWriter()
Method Detail

isCompress

public boolean isCompress()
Returns whether to compress the output.

Since:
3.6.3

setCompress

public void setCompress(boolean compress)
Description copied from interface: AuWriter
Sets whether to compress the output with GZIP.

Default: true.

Specified by:
setCompress in interface AuWriter

open

public AuWriter open(java.lang.Object request,
                     java.lang.Object response,
                     int timeout)
              throws java.io.IOException
Opens the connection.

Default: it creates an object to store the responses.

This implementation doesn't support the timeout argument.

Specified by:
open in interface AuWriter
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
Closes the connection.

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

getResult

protected java.lang.String getResult()
Returns the result of responses that will be sent to client (never null). It is called by close(java.lang.Object, java.lang.Object) to retrieve the output. After invocation, the writer is reset.

Since:
5.0.0

writeResponseId

public void writeResponseId(int resId)
                     throws java.io.IOException
Description copied from interface: AuWriter
Generates the response ID to the output.

Specified by:
writeResponseId in interface AuWriter
Throws:
java.io.IOException
See Also:
DesktopCtrl.getResponseId(boolean)

write

public void write(AuResponse response)
           throws java.io.IOException
Description copied from interface: AuWriter
Generates the specified the response to the output.

Specified by:
write in interface AuWriter
Throws:
java.io.IOException

write

public void write(java.util.Collection responses)
           throws java.io.IOException
Description copied from interface: AuWriter
Generates a list of responses to the output.

Specified by:
write in interface AuWriter
Throws:
java.io.IOException


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