org.atmosphere.gwt.server
Interface GwtResponseWriter

All Known Implementing Classes:
GwtResponseWriterImpl, HTTPRequestResponseWriter, IEHTMLFileResponseWriter, IEXDomainRequestResponseWriter, IFrameResponseWriter, ManagedStreamResponseWriter, OperaEventSourceResponseWriter, StreamingProtocolResponseWriter, WebsocketResponseWriter

public interface GwtResponseWriter

A Comet response provides methods for sending messages using the associated HTTP response. It also provides methods for setting up Comet sessions.

Author:
Richard Zschech

Method Summary
 long getLastWriteTime()
          Returns the last time a write has been performed
 void heartbeat()
          Write a heartbeat message to the associated HTTP response.
 boolean isTerminated()
          Test if this Comet response has been terminated by calling the terminate() method or terminated from the HTTP client disconnecting.
 void sendError(int statusCode)
          Send an error before the response is sent.
 void sendError(int statusCode, String message)
          Send an error before the response is sent.
 void terminate()
          Write a terminate message to the associated HTTP response and close the HTTP output stream/
 void write(List<? extends Serializable> messages)
          Write a list of message to the associated HTTP response.
 void write(List<? extends Serializable> messages, boolean flush)
          Write a list of message to the associated HTTP response.
 void write(Serializable message)
          Write a single message to the associated HTTP response.
 void write(Serializable message, boolean flush)
          Write a single message to the associated HTTP response.
 

Method Detail

write

void write(Serializable message)
           throws IOException
Write a single message to the associated HTTP response.

Parameters:
message -
Throws:
IOException

write

void write(Serializable message,
           boolean flush)
           throws IOException
Write a single message to the associated HTTP response. Flush the HTTP output stream if flush is true.

Parameters:
message -
flush -
Throws:
IOException

write

void write(List<? extends Serializable> messages)
           throws IOException
Write a list of message to the associated HTTP response. This method may be more optimal to the single message version.

Parameters:
messages -
Throws:
IOException

write

void write(List<? extends Serializable> messages,
           boolean flush)
           throws IOException
Write a list of message to the associated HTTP response. This method may be more optimal to the single message version. Flush the HTTP output stream if flush is true.

Parameters:
messages -
flush -
Throws:
IOException

heartbeat

void heartbeat()
               throws IOException
Write a heartbeat message to the associated HTTP response.

Throws:
IOException

terminate

void terminate()
               throws IOException
Write a terminate message to the associated HTTP response and close the HTTP output stream/

Throws:
IOException

isTerminated

boolean isTerminated()
Test if this Comet response has been terminated by calling the terminate() method or terminated from the HTTP client disconnecting.

Returns:
if this Comet response has been terminated

getLastWriteTime

long getLastWriteTime()
Returns the last time a write has been performed

Returns:

sendError

void sendError(int statusCode)
               throws IOException
Send an error before the response is sent.

Parameters:
statusCode -
Throws:
IOException

sendError

void sendError(int statusCode,
               String message)
               throws IOException
Send an error before the response is sent.

Parameters:
statusCode -
message -
Throws:
IOException


Copyright © 2012. All Rights Reserved.