public abstract class AbstractVirtualListenerManager<E extends Event,L extends EventListener<E>> extends java.lang.Object implements ListenerService<E,L>, VnetService
Modifier and Type | Field and Description |
---|---|
protected EventDeliveryService |
eventDispatcher |
protected VirtualNetworkService |
manager |
protected NetworkId |
networkId |
protected ServiceDirectory |
serviceDirectory |
Constructor and Description |
---|
AbstractVirtualListenerManager(VirtualNetworkService manager,
NetworkId networkId,
java.lang.Class<? extends Event> eventClass) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(L listener)
Adds the specified listener.
|
NetworkId |
networkId() |
protected void |
post(E event)
Safely posts the specified event to the local event dispatcher.
|
void |
removeListener(L listener)
Removes the specified listener.
|
protected final NetworkId networkId
protected final VirtualNetworkService manager
protected final ServiceDirectory serviceDirectory
protected EventDeliveryService eventDispatcher
public AbstractVirtualListenerManager(VirtualNetworkService manager, NetworkId networkId, java.lang.Class<? extends Event> eventClass)
public void addListener(L listener)
ListenerService
addListener
in interface ListenerService<E extends Event,L extends EventListener<E>>
listener
- listener to be addedpublic void removeListener(L listener)
ListenerService
removeListener
in interface ListenerService<E extends Event,L extends EventListener<E>>
listener
- listener to be removedprotected void post(E event)
event
- event to be posted; may be nullpublic NetworkId networkId()
networkId
in interface VnetService