org.cruxframework.crux.plugin.gadget.client.features.impl
Class PubsubFeatureImpl

java.lang.Object
  extended by org.cruxframework.crux.plugin.gadget.client.features.impl.PubsubFeatureImpl
All Implemented Interfaces:
PubsubFeature

public class PubsubFeatureImpl
extends Object
implements PubsubFeature

Author:
Thiago da Rosa de Bustamante

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.cruxframework.crux.plugin.gadget.client.features.PubsubFeature
PubsubFeature.Callback
 
Method Summary
 void publish(String channelName, String message)
          Publish a message on the specified channel.
 void subscribe(String channelName, PubsubFeature.Callback callback)
          Subscribes to the specified channel.
 void unsubscribe(String channelName)
          Unsubscribes from the specified 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(String channelName,
                    String message)
Description copied from interface: PubsubFeature
Publish a message on the specified channel. All subscribers of the channel will be notified, through its Callback objects.

Specified by:
publish in interface PubsubFeature

subscribe

public void subscribe(String channelName,
                      PubsubFeature.Callback callback)
Description copied from interface: PubsubFeature
Subscribes to the specified channel. Whenever any gadget publish some message to the channel, the callback object will be informed (through onMessage() method).

Specified by:
subscribe in interface PubsubFeature

unsubscribe

public void unsubscribe(String channelName)
Description copied from interface: PubsubFeature
Unsubscribes from the specified channel. No more notifications will be received.

Specified by:
unsubscribe in interface PubsubFeature


Copyright © 2014. All rights reserved.