com.google.gwt.gadgets.client
Class PubSubFeature

java.lang.Object
  extended by com.google.gwt.gadgets.client.PubSubFeature
All Implemented Interfaces:
GadgetFeature

public class PubSubFeature
extends java.lang.Object
implements GadgetFeature

Provides access to the Ads APIs provided by the container.


Nested Class Summary
static interface PubSubFeature.PubSubCallback
           
 
Nested classes/interfaces inherited from interface com.google.gwt.gadgets.client.GadgetFeature
GadgetFeature.FeatureName, GadgetFeature.MayRequire
 
Method Summary
 void publish(java.lang.String channelName, java.lang.String message)
          Publishes a string-type message to a channel.
 void subscribe(java.lang.String channelName, PubSubFeature.PubSubCallback callback)
          Subscribes a gadget to a message channel.
 void unsubscribe(java.lang.String channelName)
          Unsubscribes the gadget from a message channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

publish

public void publish(java.lang.String channelName,
                    java.lang.String message)
Publishes a string-type message to a channel.

Parameters:
channelName - the name of the channel
message - the message to publish

subscribe

public void subscribe(java.lang.String channelName,
                      PubSubFeature.PubSubCallback callback)
Subscribes a gadget to a message channel.

Parameters:
channelName - the name of the channel
callback - A function that will be called with the channel messages

unsubscribe

public void unsubscribe(java.lang.String channelName)
Unsubscribes the gadget from a message channel.

Parameters:
channelName - the name of the channel