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

Field Summary
protected  java.io.StringWriter _out
          The writer used to generate the output to.
 
Constructor Summary
HttpAuWriter()
           
 
Method Summary
 void close(java.lang.Object request, java.lang.Object response)
          Closes the connection.
protected  void flush(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Flushes the bufferred output (_out) to the client.
 java.lang.String getChannel()
          Returns au to represent the response channel for AU requests.
 AuWriter open(java.lang.Object request, java.lang.Object response, int timeout)
          Opens the connection.
 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
 

Field Detail

_out

protected java.io.StringWriter _out
The writer used to generate the output to.

Constructor Detail

HttpAuWriter

public HttpAuWriter()
Method Detail

getChannel

public java.lang.String getChannel()
Returns au to represent the response channel for AU requests.

Specified by:
getChannel in interface AuWriter
Since:
3.5.0

open

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

Default: it creates a StringWriter instance for _out and then generate the XML header.

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

flush

protected void flush(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws java.io.IOException
Flushes the bufferred output (_out) to the client. It is called by close(java.lang.Object, java.lang.Object).

Throws:
java.io.IOException

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.