use of org.onosproject.event.ListenerRegistry in project onos by opennetworkinglab.
the class VirtualListenerRegistryManager method process.
@Override
public void process(VirtualEvent event) {
NetworkId networkId = event.networkId();
Event originalEvent = (Event) event.subject();
ListenerRegistry listenerRegistry = listenerMapByNetwork.get(networkId).get(originalEvent.getClass());
if (listenerRegistry != null) {
listenerRegistry.process(originalEvent);
lastStart = listenerRegistry;
}
}
use of org.onosproject.event.ListenerRegistry in project onos by opennetworkinglab.
the class VirtualListenerRegistryManager method getRegistry.
public ListenerRegistry getRegistry(NetworkId networkId, Class<? extends Event> eventClass) {
Map<Class<? extends Event>, ListenerRegistry> listenerMapByEvent = listenerMapByNetwork.get(networkId);
if (listenerMapByEvent == null) {
listenerMapByEvent = Maps.newConcurrentMap();
listenerMapByNetwork.putIfAbsent(networkId, listenerMapByEvent);
}
ListenerRegistry listenerRegistry = listenerMapByEvent.get(eventClass);
if (listenerRegistry == null) {
listenerRegistry = new ListenerRegistry();
listenerMapByEvent.putIfAbsent(eventClass, listenerRegistry);
}
return listenerRegistry;
}
Aggregations