org.zkoss.zk.au
Interface AuWriter

All Known Implementing Classes:
HttpAuWriter, SmartAuWriter

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, int) must be called first. And, close(java.lang.Object, java.lang.Object) after all responses are written.

Since:
3.0.1
Author:
tomyeh
See Also:
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.
 AuWriter open(java.lang.Object request, java.lang.Object response, int timeout)
          Initializes the writer.
 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.
 

Method Detail

setCompress

void setCompress(boolean compress)
Sets whether to compress the output with GZIP.

Default: true.

Since:
3.6.3

open

AuWriter open(java.lang.Object request,
              java.lang.Object response,
              int timeout)
              throws java.io.IOException
Initializes the writer.

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

void close(java.lang.Object request,
           java.lang.Object response)
           throws java.io.IOException
Closes the writer and flush the result to client.

Parameters:
request - the request (HttpServletRequest if HTTP)
response - the response (HttpServletResponse if HTTP)
Throws:
java.io.IOException

writeResponseId

void writeResponseId(int resId)
                     throws java.io.IOException
Generates the response ID to the output.

Throws:
java.io.IOException
Since:
3.5.0
See Also:
DesktopCtrl.getResponseId(boolean)

write

void write(AuResponse response)
           throws java.io.IOException
Generates the specified the response to the output.

Throws:
java.io.IOException

write

void write(java.util.Collection responses)
           throws java.io.IOException
Generates a list of responses to the output.

Throws:
java.io.IOException


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