|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gwtwidgets.server.spring.stream.HtmlSLStreamWriterImpl
public class HtmlSLStreamWriterImpl
Implementation of an SLStreamWriter writing incremental bits of HTML.
The intention is that a browser can access via the DOM these messages and decode them.
The GWT counterpart of this writer is the HtmlStreamReader.
The protocol explained in short:
A html/body is opened, then each message line consists of a <div>
containing the URL-encoded message content and a comma sepperated list of key=value
pairs of the message attributes
Some browsers do not start interpreting the streamed content unless the stream is either closed or the transmitted content exceeds a certain size. In order to assure a timely consumption of messages on the client side, this implementation pads messages with more data than might be necessary in certain cases.
Please note that some networks (i.e. when http proxies are involved) may not stream content prior to closing the stream. Furthermore they may impose stricter constraints on a connection's lifetime than planned. For this reasons applications should be prepared to fall back to shorter timeouts.
| Constructor Summary | |
|---|---|
HtmlSLStreamWriterImpl()
|
|
| Method Summary | |
|---|---|
void |
close()
|
void |
setResponse(javax.servlet.http.HttpServletResponse response)
|
void |
setSerialStartpoint(int serial)
|
void |
writeMessage(java.lang.String content,
java.util.Map<java.lang.String,?> attributes)
Sends a message to the recipient |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HtmlSLStreamWriterImpl()
| Method Detail |
|---|
public void setSerialStartpoint(int serial)
public void close()
close in interface SLStreamWriterpublic void setResponse(javax.servlet.http.HttpServletResponse response)
public void writeMessage(java.lang.String content,
java.util.Map<java.lang.String,?> attributes)
SLStreamWriter
writeMessage in interface SLStreamWritercontent - String content of the messageattributes - Metadata of the message, can be any key/value set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||