Package org.wicketstuff.push
Class AbstractPushService
- java.lang.Object
-
- org.wicketstuff.push.AbstractPushService
-
- All Implemented Interfaces:
IPushService
public abstract class AbstractPushService extends Object implements IPushService
- Author:
- Sebastian Thomschke
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<IPushNodeDisconnectedListener>disconnectListenersprotected ConcurrentHashMap<IPushChannel<?>,CopyOnWriteArraySet<IPushNode<?>>>nodesByChannels
-
Constructor Summary
Constructors Constructor Description AbstractPushService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNodeDisconnectedListener(IPushNodeDisconnectedListener listener)<EventType>
voidconnectToChannel(IPushNode<EventType> node, IPushChannel<EventType> channel)Connects the given push node to the given push channel<EventType>
IPushChannel<EventType>createChannel(String label)Creates a new push channel with the givenlabel.protected voiddisconnectFromAllChannels(IPushNode<?> node)<EventType>
voiddisconnectFromChannel(IPushNode<EventType> node, IPushChannel<EventType> channel)<EventType>
voidremoveChannel(IPushChannel<EventType> channel)voidremoveNodeDisconnectedListener(IPushNodeDisconnectedListener listener)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.wicketstuff.push.IPushService
installNode, isConnected, publish, publish, uninstallNode
-
-
-
-
Field Detail
-
nodesByChannels
protected final ConcurrentHashMap<IPushChannel<?>,CopyOnWriteArraySet<IPushNode<?>>> nodesByChannels
-
disconnectListeners
protected final Set<IPushNodeDisconnectedListener> disconnectListeners
-
-
Method Detail
-
addNodeDisconnectedListener
public void addNodeDisconnectedListener(IPushNodeDisconnectedListener listener)
- Specified by:
addNodeDisconnectedListenerin interfaceIPushService
-
connectToChannel
public <EventType> void connectToChannel(IPushNode<EventType> node, IPushChannel<EventType> channel)
Connects the given push node to the given push channel- Specified by:
connectToChannelin interfaceIPushService
-
createChannel
public <EventType> IPushChannel<EventType> createChannel(String label)
Creates a new push channel with the givenlabel.- Specified by:
createChannelin interfaceIPushService- Parameters:
label- the label to associate with the new push channel. (may be null)Note: The
labelhas only informative purpose. Creating two push channels with the same label will not result in an error.
-
disconnectFromAllChannels
protected void disconnectFromAllChannels(IPushNode<?> node)
-
disconnectFromChannel
public <EventType> void disconnectFromChannel(IPushNode<EventType> node, IPushChannel<EventType> channel)
- Specified by:
disconnectFromChannelin interfaceIPushService
-
removeChannel
public <EventType> void removeChannel(IPushChannel<EventType> channel)
- Specified by:
removeChannelin interfaceIPushService
-
removeNodeDisconnectedListener
public void removeNodeDisconnectedListener(IPushNodeDisconnectedListener listener)
- Specified by:
removeNodeDisconnectedListenerin interfaceIPushService
-
-