org.cometd.bayeux.server
Interface ServerChannel

All Superinterfaces:
Channel

public interface ServerChannel
extends Channel

Server side representation of a Bayeux Channel.

The ServerChannel is the entity that holds the set of ServerSessions that are subscribed to a channel. A message published to a ServerChannel will be delivered to all the ServerSession's subscribed to the channel.

A ServerChannel is distinct from a SessionChannel, which is the client side representation of a channel (note there can be clients within the server JVM).


Nested Class Summary
static interface ServerChannel.MessageListener
           
static interface ServerChannel.ServerChannelListener
           
static interface ServerChannel.SubscriptionListener
           
 
Field Summary
 
Fields inherited from interface org.cometd.bayeux.Channel
META_CONNECT, META_DISCONNECT, META_HANDSHAKE, META_SUBSCRIBE, META_UNSUBSCRIBE
 
Method Summary
 void addListener(ServerChannel.ServerChannelListener listener)
           
 java.util.Set<? extends ServerSession> getSubscribers()
           
 boolean isBroadcast()
           
 boolean isLazy()
           
 boolean isPersistent()
           
 void publish(Session from, java.lang.Object data, java.lang.Object id)
          Publish a message to the channel.
 void publish(Session from, ServerMessage message)
          Publish a message to the channel.
 void remove()
          Remove a channel
 void removeListener(ServerChannel.ServerChannelListener listener)
           
 void setLazy(boolean lazy)
          Set lazy channel
 void setPersistent(boolean persistent)
          Set persistent channel
 
Methods inherited from interface org.cometd.bayeux.Channel
getId, isDeepWild, isMeta, isService, isWild
 

Method Detail

addListener

void addListener(ServerChannel.ServerChannelListener listener)
Parameters:
listener -

removeListener

void removeListener(ServerChannel.ServerChannelListener listener)
Parameters:
listener -

getSubscribers

java.util.Set<? extends ServerSession> getSubscribers()
Returns:

isBroadcast

boolean isBroadcast()
Returns:

isLazy

boolean isLazy()
Returns:

isPersistent

boolean isPersistent()
Returns:

setLazy

void setLazy(boolean lazy)
Set lazy channel

Parameters:
lazy - If true, all messages published to this channel will be marked as lazy.

setPersistent

void setPersistent(boolean persistent)
Set persistent channel

Parameters:
persistent - If true, the channel will not be removed when the last subscription is removed.

publish

void publish(Session from,
             ServerMessage message)
Publish a message to the channel.

Delivered a message to all the ServerSession's subscribed to the channel.

Parameters:
message -

publish

void publish(Session from,
             java.lang.Object data,
             java.lang.Object id)
Publish a message to the channel.

Delivered a message to all the ServerSession's subscribed to the channel.

Parameters:
data -

remove

void remove()
Remove a channel



Copyright © 2010 Dojo Foundation. All Rights Reserved.