org.cruxframework.crux.plugin.gadget.client.features
Interface PubsubFeature

All Known Implementing Classes:
PubsubFeatureImpl

public interface PubsubFeature

Provides access to the pubsub feature.

Author:
Thiago da Rosa de Bustamante

Nested Class Summary
static interface PubsubFeature.Callback
          Handler for messages received from an observed channel
 
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.
 

Method Detail

publish

void publish(String channelName,
             String message)
Publish a message on the specified channel. All subscribers of the channel will be notified, through its Callback objects.

Parameters:
channelName -
message -

subscribe

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

Parameters:
channelName -
callback -

unsubscribe

void unsubscribe(String channelName)
Unsubscribes from the specified channel. No more notifications will be received.

Parameters:
channelName -


Copyright © 2014. All rights reserved.