org.mortbay.cometd
Class ChannelImpl

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

public class ChannelImpl
extends Object
implements org.cometd.Channel

A Bayuex Channel

Author:
gregw

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

Constructor Detail

ChannelImpl

protected ChannelImpl(String id,
                      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.

Specified by:
isLazy in interface org.cometd.Channel
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.

Specified by:
setLazy in interface org.cometd.Channel
Parameters:
lazy - true if message is lazy

addChild

public ChannelImpl addChild(ChannelImpl channel)
Add a channel

Parameters:
channel -
Returns:
The added channel, or the existing channel if another thread already added the channel

addDataFilter

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

getChannelId

public ChannelId getChannelId()
Returns:

getChild

public ChannelImpl getChild(ChannelId id)

getChannels

public void getChannels(List<org.cometd.Channel> list)

getChannelCount

public int getChannelCount()

getId

public String getId()
Specified by:
getId in interface org.cometd.Channel
Returns:

isPersistent

public boolean isPersistent()
Specified by:
isPersistent in interface org.cometd.Channel

deliver

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

publish

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

publishLazy

public void publishLazy(org.cometd.Client fromClient,
                        Object data,
                        String msgId)

remove

public boolean remove()
Specified by:
remove in interface org.cometd.Channel

doRemove

public boolean doRemove(ChannelImpl channel,
                        List<org.cometd.ChannelBayeuxListener> listeners)

removeDataFilter

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

setPersistent

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

subscribe

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

toString

public String toString()
Overrides:
toString in class Object

unsubscribe

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

doDelivery

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

getSubscribers

public Collection<org.cometd.Client> getSubscribers()
Specified by:
getSubscribers in interface org.cometd.Channel

getSubscriberCount

public int getSubscriberCount()
Specified by:
getSubscriberCount in interface org.cometd.Channel

getDataFilters

public Collection<org.cometd.DataFilter> getDataFilters()
Specified by:
getDataFilters in interface org.cometd.Channel

addListener

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

removeListener

public void removeListener(org.cometd.ChannelListener listener)
Specified by:
removeListener in interface org.cometd.Channel


Copyright © 1995-2009 Mort Bay Consulting. All Rights Reserved.