cometedgwt.auction.client
Interface StreamingService

All Known Implementing Classes:
StreamingServiceGWTClientImpl

public interface StreamingService


Method Summary
 void sendMessage(String topicName, com.google.gwt.json.client.JSONValue object)
          With this method clients can push JSON data on a named topic.
 void sendMessage(String topicName, String data)
          With this method clients can push String data on a named topic.
 void subScribeToEvent(String topicName, com.google.gwt.user.client.rpc.AsyncCallback callback)
          GWT clients use this method to subscribe to a named stream.
 

Method Detail

sendMessage

void sendMessage(String topicName,
                 String data)
With this method clients can push String data on a named topic.

Parameters:
topicName -
data -

sendMessage

void sendMessage(String topicName,
                 com.google.gwt.json.client.JSONValue object)
With this method clients can push JSON data on a named topic. For instance, to send an Object with a nested array of one element to the "topic" topic: JSONArray array = new JSONArray(); array.add(new JSONString("string value"); JSONObject object = new JSONObject(); object.put("array", array); StreamingServiceGWTClientImpl.getInstance().sendMessage("topic", container); The onSuccess method of the registered clients will be then called with an already parsed JSONObject. Because of a limit of the JSONParser, you can't send JSONArrays directly, but they must be encapsulated inside a container JSONObject (like in the example).

Parameters:
topicName -
data -

subScribeToEvent

void subScribeToEvent(String topicName,
                      com.google.gwt.user.client.rpc.AsyncCallback callback)
GWT clients use this method to subscribe to a named stream. They will receive events on the AsyncCallback passed as parameter.

Parameters:
topicName -
callback -


Copyright © 2011. All Rights Reserved.