|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.gwtwidgets.client.stream.HtmlStreamReader
public class HtmlStreamReader
Decodes SL stream protocol messages sent via the
HtmlSLStreamWriterImpl. This implementation creates an invisible
IFrame which is appended to the current document and polled in intervals.
Decoded messages are then removed from the DOM in order to reduce resource
consumption.
| Field Summary | |
|---|---|
protected java.util.Date |
dateOfCreation
|
protected com.google.gwt.dom.client.IFrameElement |
frame
|
protected int |
lastMessageId
|
protected long |
maxAge
|
protected long |
pollingInterval
|
protected com.google.gwt.user.client.Timer |
timer
|
| Constructor Summary | |
|---|---|
HtmlStreamReader()
|
|
| Method Summary | |
|---|---|
void |
close()
Should be called if the client wants to close the stream communication with the server. |
protected com.google.gwt.dom.client.Element |
getFrame()
|
protected com.google.gwt.dom.client.Document |
getFrameContents(com.google.gwt.dom.client.IFrameElement frame)
|
long |
getPollingInterval()
|
void |
readAsync(java.lang.String url,
StreamCallback callback)
Connects to a URL an starts streaming messages from there. |
protected Message |
readNextMessage()
|
protected void |
reconnect(java.lang.String url,
StreamCallback callback)
|
void |
setInnerFrameVisibility(boolean status)
For debugging purposes, can be used to show the IFrame used to receive server messages. |
void |
setMaxAge(long maxAge)
Determines the age (in ms) of a connection to a server before closing and refreshing it |
void |
setPollingInterval(long pollingInterval)
Sets a polling interval - messages arriving from the server will be decoded every such interval. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected com.google.gwt.dom.client.IFrameElement frame
protected long pollingInterval
protected long maxAge
protected com.google.gwt.user.client.Timer timer
protected java.util.Date dateOfCreation
protected int lastMessageId
| Constructor Detail |
|---|
public HtmlStreamReader()
| Method Detail |
|---|
protected com.google.gwt.dom.client.Document getFrameContents(com.google.gwt.dom.client.IFrameElement frame)
protected Message readNextMessage()
public long getPollingInterval()
public void setPollingInterval(long pollingInterval)
Timer.schedule(int) which receives an integer argument; hence
large values for pollingInterval will not yield the
desired behavior.
pollingInterval - Polling interval in millisecondsprotected com.google.gwt.dom.client.Element getFrame()
public void setInnerFrameVisibility(boolean status)
status -
public void readAsync(java.lang.String url,
StreamCallback callback)
HtmlStreamReader
is a stateful object which cannot be used to simultaneously access more
resources.
url - callback -
protected void reconnect(java.lang.String url,
StreamCallback callback)
public void close()
public void setMaxAge(long maxAge)
maxAge -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||