org.cometd.server
Class ChannelImpl

java.lang.Object
  extended by org.cometd.server.ChannelImpl
All Implemented Interfaces:
Channel
Direct Known Subclasses:
AbstractBayeux.ServiceChannel

public class ChannelImpl
extends java.lang.Object
implements Channel

A Bayuex Channel

Author:
gregw

Field Summary
protected  AbstractBayeux _bayeux
           
 
Method Summary
 void addChild(ChannelImpl channel)
           
 void addDataFilter(DataFilter filter)
           
 void addListener(ChannelListener listener)
           
 void deliver(Client from, java.lang.Iterable<Client> to, java.lang.Object data, java.lang.String id)
           
protected  void doDelivery(ChannelId to, Client from, Message msg)
           
 boolean doRemove(ChannelImpl channel)
           
 int getChannelCount()
           
 ChannelId getChannelId()
           
 void getChannels(java.util.List<Channel> list)
           
 ChannelImpl getChild(ChannelId id)
           
 java.util.Collection<DataFilter> getDataFilters()
           
 java.lang.String getId()
           
 int getSubscriberCount()
           
 java.util.Collection<Client> getSubscribers()
           
 boolean isLazy()
          A Lazy channel marks published messages as lazy.
 boolean isPersistent()
           
 void publish(Client fromClient, java.lang.Object data, java.lang.String msgId)
           
 void publishLazy(Client fromClient, java.lang.Object data, java.lang.String msgId)
           
 boolean remove()
           
 DataFilter removeDataFilter(DataFilter filter)
           
 void setLazy(boolean lazy)
          A Lazy channel marks published messages as lazy.
 void setPersistent(boolean persistent)
           
 void subscribe(Client client)
           
 java.lang.String toString()
           
 void unsubscribe(Client client)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_bayeux

protected AbstractBayeux _bayeux
Method Detail

isLazy

public boolean isLazy()
A Lazy channel marks published messages as lazy. Lazy messages are queued but do not wake up waiting clients.

Returns:
true if message is lazy

setLazy

public void setLazy(boolean lazy)
A Lazy channel marks published messages as lazy. Lazy messages are queued but do not wake up waiting clients.

Parameters:
lazy - true if message is lazy

addChild

public void addChild(ChannelImpl channel)

addDataFilter

public void addDataFilter(DataFilter filter)
Specified by:
addDataFilter in interface Channel
Parameters:
filter -

getChannelId

public ChannelId getChannelId()
Returns:

getChild

public ChannelImpl getChild(ChannelId id)

getChannels

public void getChannels(java.util.List<Channel> list)

getChannelCount

public int getChannelCount()

getId

public java.lang.String getId()
Specified by:
getId in interface Channel
Returns:

isPersistent

public boolean isPersistent()
Specified by:
isPersistent in interface Channel

deliver

public void deliver(Client from,
                    java.lang.Iterable<Client> to,
                    java.lang.Object data,
                    java.lang.String id)

publish

public void publish(Client fromClient,
                    java.lang.Object data,
                    java.lang.String msgId)
Specified by:
publish in interface Channel

publishLazy

public void publishLazy(Client fromClient,
                        java.lang.Object data,
                        java.lang.String msgId)

remove

public boolean remove()
Specified by:
remove in interface Channel

doRemove

public boolean doRemove(ChannelImpl channel)

removeDataFilter

public DataFilter removeDataFilter(DataFilter filter)
Specified by:
removeDataFilter in interface Channel
Parameters:
filter -

setPersistent

public void setPersistent(boolean persistent)
Specified by:
setPersistent in interface Channel

subscribe

public void subscribe(Client client)
Specified by:
subscribe in interface Channel
Parameters:
client -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

unsubscribe

public void unsubscribe(Client client)
Specified by:
unsubscribe in interface Channel
Parameters:
client -

doDelivery

protected void doDelivery(ChannelId to,
                          Client from,
                          Message msg)

getSubscribers

public java.util.Collection<Client> getSubscribers()
Specified by:
getSubscribers in interface Channel

getSubscriberCount

public int getSubscriberCount()
Specified by:
getSubscriberCount in interface Channel

getDataFilters

public java.util.Collection<DataFilter> getDataFilters()
Specified by:
getDataFilters in interface Channel

addListener

public void addListener(ChannelListener listener)
Specified by:
addListener in interface Channel


Copyright © 2009 Dojo Foundation. All Rights Reserved.