org.cometd.bayeux.client
Interface ClientSessionChannel

All Superinterfaces:
Channel

public interface ClientSessionChannel
extends Channel

A client side channel representation.

A ClientSessionChannel is scoped to a particular ClientSession that is obtained by a call to ClientSession.getChannel(String).

Typical usage examples are:

     clientSession.getChannel("/foo/bar").subscribe(mySubscriptionListener);
     clientSession.getChannel("/foo/bar").publish("Hello");
     clientSession.getChannel("/meta/*").addListener(myMetaChannelListener);
 

Version:
$Revision: 1295 $ $Date: 2010-06-18 19:57:20 +1000 (Fri, 18 Jun 2010) $

Nested Class Summary
static interface ClientSessionChannel.ClientSessionChannelListener
          Represents a listener on a ClientSessionChannel.
static interface ClientSessionChannel.MessageListener
          A listener for messages on a ClientSessionChannel.
 
Field Summary
 
Fields inherited from interface org.cometd.bayeux.Channel
META, META_CONNECT, META_DISCONNECT, META_HANDSHAKE, META_SUBSCRIBE, META_UNSUBSCRIBE
 
Method Summary
 void addListener(ClientSessionChannel.ClientSessionChannelListener listener)
           
 ClientSession getSession()
           
 void publish(Object data)
          Equivalent to publish(data, null).
 void publish(Object data, String messageId)
          Publishes the given data to this channel, optionally specifying the messageId to set on the publish message.
 void removeListener(ClientSessionChannel.ClientSessionChannelListener listener)
           
 void subscribe(ClientSessionChannel.MessageListener listener)
           
 void unsubscribe()
           
 void unsubscribe(ClientSessionChannel.MessageListener listener)
           
 
Methods inherited from interface org.cometd.bayeux.Channel
getId, isDeepWild, isMeta, isService, isWild
 

Method Detail

addListener

void addListener(ClientSessionChannel.ClientSessionChannelListener listener)
Parameters:
listener - the listener to add

removeListener

void removeListener(ClientSessionChannel.ClientSessionChannelListener listener)
Parameters:
listener - the listener to remove

getSession

ClientSession getSession()
Returns:
the client session associated with this channel

publish

void publish(Object data)
Equivalent to publish(data, null).

Parameters:
data - the data to publish

publish

void publish(Object data,
             String messageId)
Publishes the given data to this channel, optionally specifying the messageId to set on the publish message.

Parameters:
data - the data to publish
messageId - the message id to set on the message, or null to let the implementation choose the message id.
See Also:
Message.getId()

subscribe

void subscribe(ClientSessionChannel.MessageListener listener)

unsubscribe

void unsubscribe(ClientSessionChannel.MessageListener listener)

unsubscribe

void unsubscribe()


Copyright © 2008-2010 Dojo Foundation. All Rights Reserved.