|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object play.mvc.Results.Chunks<java.lang.String> play.libs.Comet
public abstract class Comet
A Chunked stream sending Comet messages.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class play.mvc.Results.Chunks |
---|
Results.Chunks.Out<A> |
Constructor Summary | |
---|---|
Comet(java.lang.String callbackMethod)
Create a new Comet socket |
Method Summary | |
---|---|
void |
close()
Close the channel |
protected java.lang.String |
initialBuffer()
Initial chunk of data to send for browser compatibility (default to send 5Kb of blank data). |
abstract void |
onConnected()
The socket is ready, you can start sending messages. |
void |
onDisconnected(F.Callback0 callback)
Add a callback to be notified when the client has disconnected. |
void |
onReady(Results.Chunks.Out<java.lang.String> out)
Called when the Chunked stream is ready. |
void |
sendMessage(com.fasterxml.jackson.databind.JsonNode message)
Send a Json message on this socket (will be received as Json in the Javascript callback method). |
void |
sendMessage(java.lang.String message)
Send a message on this socket (will be received as String in the Javascript callback method). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Comet(java.lang.String callbackMethod)
callbackMethod
- The Javascript callback method to call on each message.Method Detail |
---|
public void onReady(Results.Chunks.Out<java.lang.String> out)
Results.Chunks
onReady
in class Results.Chunks<java.lang.String>
out
- The out stream.protected java.lang.String initialBuffer()
public void sendMessage(java.lang.String message)
public void sendMessage(com.fasterxml.jackson.databind.JsonNode message)
public abstract void onConnected()
public void onDisconnected(F.Callback0 callback)
public void close()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |