org.atmosphere.gwt.server.impl
Class ManagedStreamResponseWriter

java.lang.Object
  extended by org.atmosphere.gwt.server.impl.GwtResponseWriterImpl
      extended by org.atmosphere.gwt.server.impl.ManagedStreamResponseWriter
All Implemented Interfaces:
GwtResponseWriter
Direct Known Subclasses:
IFrameResponseWriter, StreamingProtocolResponseWriter

public abstract class ManagedStreamResponseWriter
extends GwtResponseWriterImpl

Author:
p.havelaar

Field Summary
protected  boolean chrome
           
protected  Integer length
           
 
Fields inherited from class org.atmosphere.gwt.server.impl.GwtResponseWriterImpl
logger, resource, shouldEscapeText, writer
 
Constructor Summary
ManagedStreamResponseWriter(GwtAtmosphereResourceImpl resource)
           
 
Method Summary
protected abstract  void doRefresh()
           
protected  void doSuspend()
           
protected  OutputStream getOutputStream(OutputStream outputStream)
           
protected abstract  CharSequence getPadding(int padding)
           
protected abstract  int getPaddingRequired()
           
 void heartbeat()
          Write a heartbeat message to the associated HTTP response.
protected abstract  boolean isOverRefreshLength(int written)
           
 void write(List<? extends Serializable> messages, boolean flush)
          Write a list of message to the associated HTTP response.
 
Methods inherited from class org.atmosphere.gwt.server.impl.GwtResponseWriterImpl
doHeartbeat, doSendError, doTerminate, doWrite, escapeText, getJsonSerializer, getLastWriteTime, getRequest, getResponse, getSerializationMode, hasSession, initiate, isTerminated, sendError, sendError, serialize, shouldEscapeText, supportsDeflate, suspend, terminate, write, write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

length

protected Integer length

chrome

protected final boolean chrome
Constructor Detail

ManagedStreamResponseWriter

public ManagedStreamResponseWriter(GwtAtmosphereResourceImpl resource)
Method Detail

getOutputStream

protected OutputStream getOutputStream(OutputStream outputStream)
Overrides:
getOutputStream in class GwtResponseWriterImpl

doSuspend

protected void doSuspend()
                  throws IOException
Specified by:
doSuspend in class GwtResponseWriterImpl
Throws:
IOException

write

public void write(List<? extends Serializable> messages,
                  boolean flush)
           throws IOException,
                  SerializationException
Description copied from interface: GwtResponseWriter
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.

Specified by:
write in interface GwtResponseWriter
Overrides:
write in class GwtResponseWriterImpl
Throws:
IOException
SerializationException

heartbeat

public void heartbeat()
               throws IOException
Description copied from interface: GwtResponseWriter
Write a heartbeat message to the associated HTTP response.

Specified by:
heartbeat in interface GwtResponseWriter
Overrides:
heartbeat in class GwtResponseWriterImpl
Throws:
IOException

doRefresh

protected abstract void doRefresh()
                           throws IOException
Throws:
IOException

getPaddingRequired

protected abstract int getPaddingRequired()

getPadding

protected abstract CharSequence getPadding(int padding)

isOverRefreshLength

protected abstract boolean isOverRefreshLength(int written)


Copyright © 2012. All Rights Reserved.