org.wicketstuff.push
Class AbstractPushService

java.lang.Object
  extended by org.wicketstuff.push.AbstractPushService
All Implemented Interfaces:
IPushService

public abstract class AbstractPushService
extends Object
implements IPushService

Author:
Sebastian Thomschke

Field Summary
protected  Set<IPushNodeDisconnectedListener> disconnectListeners
           
protected  ConcurrentHashMap<IPushChannel<?>,CopyOnWriteArraySet<IPushNode<?>>> nodesByChannels
           
 
Constructor Summary
AbstractPushService()
           
 
Method Summary
 void addNodeDisconnectedListener(IPushNodeDisconnectedListener listener)
          
<EventType>
void
connectToChannel(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 given label.
protected  void disconnectFromAllChannels(IPushNode<?> node)
           
<EventType>
void
disconnectFromChannel(IPushNode<EventType> node, IPushChannel<EventType> channel)
          
<EventType>
void
removeChannel(IPushChannel<EventType> channel)
          
 void removeNodeDisconnectedListener(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
Constructor Detail

AbstractPushService

public AbstractPushService()
Method Detail

addNodeDisconnectedListener

public void addNodeDisconnectedListener(IPushNodeDisconnectedListener listener)

Specified by:
addNodeDisconnectedListener in interface IPushService

connectToChannel

public <EventType> void connectToChannel(IPushNode<EventType> node,
                                         IPushChannel<EventType> channel)
Connects the given push node to the given push channel

Specified by:
connectToChannel in interface IPushService

createChannel

public <EventType> IPushChannel<EventType> createChannel(String label)
Creates a new push channel with the given label.

Specified by:
createChannel in interface IPushService
Parameters:
label - the label to associate with the new push channel. (may be null)

Note: The label has 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:
disconnectFromChannel in interface IPushService

removeChannel

public <EventType> void removeChannel(IPushChannel<EventType> channel)

Specified by:
removeChannel in interface IPushService

removeNodeDisconnectedListener

public void removeNodeDisconnectedListener(IPushNodeDisconnectedListener listener)

Specified by:
removeNodeDisconnectedListener in interface IPushService


Copyright © 2013. All Rights Reserved.