tom

Changed nomenclature from Broker to Registry.

Showing 23 changed files with 102 additions and 102 deletions
1 package org.onlab.onos.event; 1 package org.onlab.onos.event;
2 2
3 /** 3 /**
4 - * Base abstraction of an event. 4 + * Base event implementation.
5 */ 5 */
6 public class AbstractEvent<T extends Enum, S extends Object> implements Event<T, S> { 6 public class AbstractEvent<T extends Enum, S extends Object> implements Event<T, S> {
7 7
......
...@@ -10,10 +10,10 @@ import static com.google.common.base.Preconditions.checkNotNull; ...@@ -10,10 +10,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
10 import static org.slf4j.LoggerFactory.getLogger; 10 import static org.slf4j.LoggerFactory.getLogger;
11 11
12 /** 12 /**
13 - * Base implementation of a manager capable of tracking listeners and 13 + * Base implementation of an event sink and a registry capable of tracking
14 - * dispatching events to them. 14 + * listeners and dispatching events to them as part of event sink processing.
15 */ 15 */
16 -public class AbstractListenerManager<E extends Event, L extends EventListener<E>> 16 +public class AbstractListenerRegistry<E extends Event, L extends EventListener<E>>
17 implements EventSink<E> { 17 implements EventSink<E> {
18 18
19 private final Logger log = getLogger(getClass()); 19 private final Logger log = getLogger(getClass());
......
...@@ -10,12 +10,12 @@ import static com.google.common.base.Preconditions.checkArgument; ...@@ -10,12 +10,12 @@ import static com.google.common.base.Preconditions.checkArgument;
10 import static com.google.common.base.Preconditions.checkNotNull; 10 import static com.google.common.base.Preconditions.checkNotNull;
11 11
12 /** 12 /**
13 - * Base implementation of event sink broker. 13 + * Base implementation of event sink registry.
14 */ 14 */
15 -public class DefaultEventSinkBroker implements EventSinkBroker { 15 +public class DefaultEventSinkRegistry implements EventSinkRegistry {
16 16
17 - private final Map<Class<? extends Event>, EventSink<? extends Event>> sinks = 17 + private final Map<Class<? extends Event>, EventSink<? extends Event>>
18 - new ConcurrentHashMap<>(); 18 + sinks = new ConcurrentHashMap<>();
19 19
20 @Override 20 @Override
21 public <E extends Event> void addSink(Class<E> eventClass, EventSink<E> sink) { 21 public <E extends Event> void addSink(Class<E> eventClass, EventSink<E> sink) {
......
1 package org.onlab.onos.event; 1 package org.onlab.onos.event;
2 2
3 /** 3 /**
4 - * Abstraction of an event. 4 + * Abstraction of an of a time-stamped event pertaining to an arbitrary subject.
5 */ 5 */
6 public interface Event<T extends Enum, S extends Object> { 6 public interface Event<T extends Enum, S extends Object> {
7 7
......
...@@ -4,5 +4,5 @@ package org.onlab.onos.event; ...@@ -4,5 +4,5 @@ package org.onlab.onos.event;
4 * Abstraction of an entity capable of accepting events to be posted and 4 * Abstraction of an entity capable of accepting events to be posted and
5 * then dispatching them to the appropriate event sink. 5 * then dispatching them to the appropriate event sink.
6 */ 6 */
7 -public interface EventDispatchService extends EventDispatcher, EventSinkBroker { 7 +public interface EventDeliveryService extends EventDispatcher, EventSinkRegistry {
8 } 8 }
......
...@@ -3,10 +3,10 @@ package org.onlab.onos.event; ...@@ -3,10 +3,10 @@ package org.onlab.onos.event;
3 import java.util.Set; 3 import java.util.Set;
4 4
5 /** 5 /**
6 - * Abstraction of an event sink broker capable of tracking sinks based on 6 + * Abstraction of an event sink registry capable of tracking sinks based on
7 * their event class. 7 * their event class.
8 */ 8 */
9 -public interface EventSinkBroker { 9 +public interface EventSinkRegistry {
10 10
11 /** 11 /**
12 * Adds the specified sink for the given event class. 12 * Adds the specified sink for the given event class.
......
1 package org.onlab.onos.net.device; 1 package org.onlab.onos.net.device;
2 2
3 -import org.onlab.onos.net.provider.ProviderBroker; 3 +import org.onlab.onos.net.provider.ProviderRegistry;
4 4
5 /** 5 /**
6 - * Abstraction of a device provider brokerage. 6 + * Abstraction of a device provider registry.
7 */ 7 */
8 -public interface DeviceProviderBroker 8 +public interface DeviceProviderRegistry
9 - extends ProviderBroker<DeviceProvider, DeviceProviderService> { 9 + extends ProviderRegistry<DeviceProvider, DeviceProviderService> {
10 } 10 }
......
1 package org.onlab.onos.net.flow; 1 package org.onlab.onos.net.flow;
2 2
3 -import org.onlab.onos.net.provider.ProviderBroker; 3 +import org.onlab.onos.net.provider.ProviderRegistry;
4 4
5 /** 5 /**
6 - * Abstraction for a flow rule provider brokerage. 6 + * Abstraction for a flow rule provider registry.
7 */ 7 */
8 -public interface FlowRuleProviderBroker 8 +public interface FlowRuleProviderRegistry
9 - extends ProviderBroker<FlowRuleProvider, FlowRuleProviderService> { 9 + extends ProviderRegistry<FlowRuleProvider, FlowRuleProviderService> {
10 } 10 }
......
1 package org.onlab.onos.net.host; 1 package org.onlab.onos.net.host;
2 2
3 -import org.onlab.onos.net.provider.ProviderBroker; 3 +import org.onlab.onos.net.provider.ProviderRegistry;
4 4
5 /** 5 /**
6 - * Abstraction of a host provider brokerage. 6 + * Abstraction of a host provider registry.
7 */ 7 */
8 -public interface HostProviderBroker 8 +public interface HostProviderRegistry
9 - extends ProviderBroker<HostProvider, HostProviderService> { 9 + extends ProviderRegistry<HostProvider, HostProviderService> {
10 } 10 }
......
1 package org.onlab.onos.net.link; 1 package org.onlab.onos.net.link;
2 2
3 -import org.onlab.onos.net.provider.ProviderBroker; 3 +import org.onlab.onos.net.provider.ProviderRegistry;
4 4
5 /** 5 /**
6 - * Abstraction of an infrastructure link provider brokerage. 6 + * Abstraction of an infrastructure link provider registry.
7 */ 7 */
8 -public interface LinkProviderBroker 8 +public interface LinkProviderRegistry
9 - extends ProviderBroker<LinkProvider, LinkProviderService> { 9 + extends ProviderRegistry<LinkProvider, LinkProviderService> {
10 } 10 }
......
...@@ -7,13 +7,13 @@ import static com.google.common.base.Preconditions.checkArgument; ...@@ -7,13 +7,13 @@ import static com.google.common.base.Preconditions.checkArgument;
7 import static com.google.common.base.Preconditions.checkNotNull; 7 import static com.google.common.base.Preconditions.checkNotNull;
8 8
9 /** 9 /**
10 - * Base implementation of provider broker. 10 + * Base implementation of provider registry.
11 * 11 *
12 * @param <P> type of the information provider 12 * @param <P> type of the information provider
13 * @param <S> type of the provider service 13 * @param <S> type of the provider service
14 */ 14 */
15 -public abstract class AbstractProviderBroker<P extends Provider, S extends ProviderService<P>> 15 +public abstract class AbstractProviderRegistry<P extends Provider, S extends ProviderService<P>>
16 - implements ProviderBroker<P, S> { 16 + implements ProviderRegistry<P, S> {
17 17
18 private final Map<ProviderId, S> services = new HashMap<>(); 18 private final Map<ProviderId, S> services = new HashMap<>();
19 19
......
1 package org.onlab.onos.net.provider; 1 package org.onlab.onos.net.provider;
2 2
3 /** 3 /**
4 - * Broker used for registering/unregistering information providers with the core. 4 + * Registry for tracking information providers with the core.
5 * 5 *
6 * @param <P> type of the information provider 6 * @param <P> type of the information provider
7 * @param <S> type of the provider service 7 * @param <S> type of the provider service
8 */ 8 */
9 -public interface ProviderBroker<P extends Provider, S extends ProviderService<P>> { 9 +public interface ProviderRegistry<P extends Provider, S extends ProviderService<P>> {
10 10
11 /** 11 /**
12 * Registers the supplied provider with the core. 12 * Registers the supplied provider with the core.
......
1 package org.onlab.onos.net.topology; 1 package org.onlab.onos.net.topology;
2 2
3 -import org.onlab.onos.net.provider.ProviderBroker; 3 +import org.onlab.onos.net.provider.ProviderRegistry;
4 4
5 /** 5 /**
6 - * Abstraction of a network topology provider brokerage. 6 + * Abstraction of a network topology provider registry.
7 */ 7 */
8 -public interface TopologyProviderBroker extends 8 +public interface TopologyProviderRegistry extends
9 - ProviderBroker<TopologyProvider, TopologyProviderService> { 9 + ProviderRegistry<TopologyProvider, TopologyProviderService> {
10 } 10 }
......
...@@ -8,13 +8,13 @@ import static org.junit.Assert.assertTrue; ...@@ -8,13 +8,13 @@ import static org.junit.Assert.assertTrue;
8 /** 8 /**
9 * Tests of the base listener manager. 9 * Tests of the base listener manager.
10 */ 10 */
11 -public class AbstractListenerManagerTest { 11 +public class AbstractListenerRegistryTest {
12 12
13 @Test 13 @Test
14 public void basics() { 14 public void basics() {
15 TestListener listener = new TestListener(); 15 TestListener listener = new TestListener();
16 TestListener secondListener = new TestListener(); 16 TestListener secondListener = new TestListener();
17 - TestListenerManager manager = new TestListenerManager(); 17 + TestListenerRegistry manager = new TestListenerRegistry();
18 manager.addListener(listener); 18 manager.addListener(listener);
19 manager.addListener(secondListener); 19 manager.addListener(secondListener);
20 20
...@@ -35,7 +35,7 @@ public class AbstractListenerManagerTest { ...@@ -35,7 +35,7 @@ public class AbstractListenerManagerTest {
35 public void badListener() { 35 public void badListener() {
36 TestListener listener = new BrokenListener(); 36 TestListener listener = new BrokenListener();
37 TestListener secondListener = new TestListener(); 37 TestListener secondListener = new TestListener();
38 - TestListenerManager manager = new TestListenerManager(); 38 + TestListenerRegistry manager = new TestListenerRegistry();
39 manager.addListener(listener); 39 manager.addListener(listener);
40 manager.addListener(secondListener); 40 manager.addListener(secondListener);
41 41
......
...@@ -6,11 +6,11 @@ import org.junit.Test; ...@@ -6,11 +6,11 @@ import org.junit.Test;
6 import static org.junit.Assert.*; 6 import static org.junit.Assert.*;
7 7
8 /** 8 /**
9 - * Tests of the default event sink broker. 9 + * Tests of the default event sink registry.
10 */ 10 */
11 -public class DefaultEventSinkBrokerTest { 11 +public class DefaultEventSinkRegistryTest {
12 12
13 - private DefaultEventSinkBroker broker; 13 + private DefaultEventSinkRegistry registry;
14 14
15 private static class FooEvent extends TestEvent { 15 private static class FooEvent extends TestEvent {
16 public FooEvent(String subject) { super(Type.FOO, subject); } 16 public FooEvent(String subject) { super(Type.FOO, subject); }
...@@ -30,23 +30,23 @@ public class DefaultEventSinkBrokerTest { ...@@ -30,23 +30,23 @@ public class DefaultEventSinkBrokerTest {
30 30
31 @Before 31 @Before
32 public void setUp() { 32 public void setUp() {
33 - broker = new DefaultEventSinkBroker(); 33 + registry = new DefaultEventSinkRegistry();
34 } 34 }
35 35
36 @Test 36 @Test
37 public void basics() { 37 public void basics() {
38 FooSink fooSink = new FooSink(); 38 FooSink fooSink = new FooSink();
39 BarSink barSink = new BarSink(); 39 BarSink barSink = new BarSink();
40 - broker.addSink(FooEvent.class, fooSink); 40 + registry.addSink(FooEvent.class, fooSink);
41 - broker.addSink(BarEvent.class, barSink); 41 + registry.addSink(BarEvent.class, barSink);
42 42
43 - assertEquals("incorrect sink count", 2, broker.getSinks().size()); 43 + assertEquals("incorrect sink count", 2, registry.getSinks().size());
44 - assertEquals("incorrect sink", fooSink, broker.getSink(FooEvent.class)); 44 + assertEquals("incorrect sink", fooSink, registry.getSink(FooEvent.class));
45 - assertEquals("incorrect sink", barSink, broker.getSink(BarEvent.class)); 45 + assertEquals("incorrect sink", barSink, registry.getSink(BarEvent.class));
46 46
47 - broker.removeSink(FooEvent.class); 47 + registry.removeSink(FooEvent.class);
48 - assertNull("incorrect sink", broker.getSink(FooEvent.class)); 48 + assertNull("incorrect sink", registry.getSink(FooEvent.class));
49 - assertEquals("incorrect sink", barSink, broker.getSink(BarEvent.class)); 49 + assertEquals("incorrect sink", barSink, registry.getSink(BarEvent.class));
50 50
51 } 51 }
52 } 52 }
......
...@@ -6,8 +6,8 @@ import java.util.List; ...@@ -6,8 +6,8 @@ import java.util.List;
6 /** 6 /**
7 * Test event listener manager fixture. 7 * Test event listener manager fixture.
8 */ 8 */
9 -public class TestListenerManager 9 +public class TestListenerRegistry
10 - extends AbstractListenerManager<TestEvent, TestListener> { 10 + extends AbstractListenerRegistry<TestEvent, TestListener> {
11 11
12 public final List<Throwable> errors = new ArrayList<>(); 12 public final List<Throwable> errors = new ArrayList<>();
13 13
......
...@@ -5,9 +5,9 @@ import org.apache.felix.scr.annotations.Component; ...@@ -5,9 +5,9 @@ import org.apache.felix.scr.annotations.Component;
5 import org.apache.felix.scr.annotations.Deactivate; 5 import org.apache.felix.scr.annotations.Deactivate;
6 import org.apache.felix.scr.annotations.Service; 6 import org.apache.felix.scr.annotations.Service;
7 import org.onlab.onos.event.AbstractEvent; 7 import org.onlab.onos.event.AbstractEvent;
8 -import org.onlab.onos.event.DefaultEventSinkBroker; 8 +import org.onlab.onos.event.DefaultEventSinkRegistry;
9 import org.onlab.onos.event.Event; 9 import org.onlab.onos.event.Event;
10 -import org.onlab.onos.event.EventDispatchService; 10 +import org.onlab.onos.event.EventDeliveryService;
11 import org.onlab.onos.event.EventSink; 11 import org.onlab.onos.event.EventSink;
12 import org.slf4j.Logger; 12 import org.slf4j.Logger;
13 13
...@@ -24,8 +24,8 @@ import static org.slf4j.LoggerFactory.getLogger; ...@@ -24,8 +24,8 @@ import static org.slf4j.LoggerFactory.getLogger;
24 */ 24 */
25 @Component(immediate = true) 25 @Component(immediate = true)
26 @Service 26 @Service
27 -public class SimpleEventDispatcher extends DefaultEventSinkBroker 27 +public class SimpleEventDispatcher extends DefaultEventSinkRegistry
28 - implements EventDispatchService { 28 + implements EventDeliveryService {
29 29
30 private final Logger log = getLogger(getClass()); 30 private final Logger log = getLogger(getClass());
31 31
......
...@@ -6,8 +6,8 @@ import org.apache.felix.scr.annotations.Deactivate; ...@@ -6,8 +6,8 @@ import org.apache.felix.scr.annotations.Deactivate;
6 import org.apache.felix.scr.annotations.Reference; 6 import org.apache.felix.scr.annotations.Reference;
7 import org.apache.felix.scr.annotations.ReferenceCardinality; 7 import org.apache.felix.scr.annotations.ReferenceCardinality;
8 import org.apache.felix.scr.annotations.Service; 8 import org.apache.felix.scr.annotations.Service;
9 -import org.onlab.onos.event.AbstractListenerManager; 9 +import org.onlab.onos.event.AbstractListenerRegistry;
10 -import org.onlab.onos.event.EventDispatchService; 10 +import org.onlab.onos.event.EventDeliveryService;
11 import org.onlab.onos.net.Device; 11 import org.onlab.onos.net.Device;
12 import org.onlab.onos.net.DeviceId; 12 import org.onlab.onos.net.DeviceId;
13 import org.onlab.onos.net.MastershipRole; 13 import org.onlab.onos.net.MastershipRole;
...@@ -17,11 +17,11 @@ import org.onlab.onos.net.device.DeviceDescription; ...@@ -17,11 +17,11 @@ import org.onlab.onos.net.device.DeviceDescription;
17 import org.onlab.onos.net.device.DeviceEvent; 17 import org.onlab.onos.net.device.DeviceEvent;
18 import org.onlab.onos.net.device.DeviceListener; 18 import org.onlab.onos.net.device.DeviceListener;
19 import org.onlab.onos.net.device.DeviceProvider; 19 import org.onlab.onos.net.device.DeviceProvider;
20 -import org.onlab.onos.net.device.DeviceProviderBroker; 20 +import org.onlab.onos.net.device.DeviceProviderRegistry;
21 import org.onlab.onos.net.device.DeviceProviderService; 21 import org.onlab.onos.net.device.DeviceProviderService;
22 import org.onlab.onos.net.device.DeviceService; 22 import org.onlab.onos.net.device.DeviceService;
23 import org.onlab.onos.net.device.PortDescription; 23 import org.onlab.onos.net.device.PortDescription;
24 -import org.onlab.onos.net.provider.AbstractProviderBroker; 24 +import org.onlab.onos.net.provider.AbstractProviderRegistry;
25 import org.onlab.onos.net.provider.AbstractProviderService; 25 import org.onlab.onos.net.provider.AbstractProviderService;
26 import org.slf4j.Logger; 26 import org.slf4j.Logger;
27 27
...@@ -36,8 +36,8 @@ import static org.slf4j.LoggerFactory.getLogger; ...@@ -36,8 +36,8 @@ import static org.slf4j.LoggerFactory.getLogger;
36 @Component(immediate = true) 36 @Component(immediate = true)
37 @Service 37 @Service
38 public class SimpleDeviceManager 38 public class SimpleDeviceManager
39 - extends AbstractProviderBroker<DeviceProvider, DeviceProviderService> 39 + extends AbstractProviderRegistry<DeviceProvider, DeviceProviderService>
40 - implements DeviceService, DeviceProviderBroker { 40 + implements DeviceService, DeviceProviderRegistry {
41 41
42 public static final String DEVICE_ID_NULL = "Device ID cannot be null"; 42 public static final String DEVICE_ID_NULL = "Device ID cannot be null";
43 public static final String PORT_NUMBER_NULL = "Port number cannot be null"; 43 public static final String PORT_NUMBER_NULL = "Port number cannot be null";
...@@ -46,17 +46,17 @@ public class SimpleDeviceManager ...@@ -46,17 +46,17 @@ public class SimpleDeviceManager
46 46
47 private final Logger log = getLogger(getClass()); 47 private final Logger log = getLogger(getClass());
48 48
49 - private final AbstractListenerManager<DeviceEvent, DeviceListener> 49 + private final AbstractListenerRegistry<DeviceEvent, DeviceListener>
50 - listenerManager = new AbstractListenerManager<>(); 50 + listenerRegistry = new AbstractListenerRegistry<>();
51 51
52 private final DeviceStore store = new DeviceStore(); 52 private final DeviceStore store = new DeviceStore();
53 53
54 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 54 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
55 - private EventDispatchService eventDispatcher; 55 + private EventDeliveryService eventDispatcher;
56 56
57 @Activate 57 @Activate
58 public void activate() { 58 public void activate() {
59 - eventDispatcher.addSink(DeviceEvent.class, listenerManager); 59 + eventDispatcher.addSink(DeviceEvent.class, listenerRegistry);
60 log.info("Started"); 60 log.info("Started");
61 } 61 }
62 62
...@@ -98,12 +98,12 @@ public class SimpleDeviceManager ...@@ -98,12 +98,12 @@ public class SimpleDeviceManager
98 98
99 @Override 99 @Override
100 public void addListener(DeviceListener listener) { 100 public void addListener(DeviceListener listener) {
101 - listenerManager.addListener(listener); 101 + listenerRegistry.addListener(listener);
102 } 102 }
103 103
104 @Override 104 @Override
105 public void removeListener(DeviceListener listener) { 105 public void removeListener(DeviceListener listener) {
106 - listenerManager.removeListener(listener); 106 + listenerRegistry.removeListener(listener);
107 } 107 }
108 108
109 @Override 109 @Override
......
...@@ -6,15 +6,15 @@ import org.apache.felix.scr.annotations.Deactivate; ...@@ -6,15 +6,15 @@ import org.apache.felix.scr.annotations.Deactivate;
6 import org.apache.felix.scr.annotations.Reference; 6 import org.apache.felix.scr.annotations.Reference;
7 import org.apache.felix.scr.annotations.ReferenceCardinality; 7 import org.apache.felix.scr.annotations.ReferenceCardinality;
8 import org.apache.felix.scr.annotations.Service; 8 import org.apache.felix.scr.annotations.Service;
9 -import org.onlab.onos.event.AbstractListenerManager; 9 +import org.onlab.onos.event.AbstractListenerRegistry;
10 -import org.onlab.onos.event.EventDispatchService; 10 +import org.onlab.onos.event.EventDeliveryService;
11 import org.onlab.onos.net.host.HostDescription; 11 import org.onlab.onos.net.host.HostDescription;
12 import org.onlab.onos.net.host.HostEvent; 12 import org.onlab.onos.net.host.HostEvent;
13 import org.onlab.onos.net.host.HostListener; 13 import org.onlab.onos.net.host.HostListener;
14 import org.onlab.onos.net.host.HostProvider; 14 import org.onlab.onos.net.host.HostProvider;
15 -import org.onlab.onos.net.host.HostProviderBroker; 15 +import org.onlab.onos.net.host.HostProviderRegistry;
16 import org.onlab.onos.net.host.HostProviderService; 16 import org.onlab.onos.net.host.HostProviderService;
17 -import org.onlab.onos.net.provider.AbstractProviderBroker; 17 +import org.onlab.onos.net.provider.AbstractProviderRegistry;
18 import org.onlab.onos.net.provider.AbstractProviderService; 18 import org.onlab.onos.net.provider.AbstractProviderService;
19 import org.slf4j.Logger; 19 import org.slf4j.Logger;
20 20
...@@ -26,21 +26,21 @@ import static org.slf4j.LoggerFactory.getLogger; ...@@ -26,21 +26,21 @@ import static org.slf4j.LoggerFactory.getLogger;
26 @Component(immediate = true) 26 @Component(immediate = true)
27 @Service 27 @Service
28 public class SimpleHostManager 28 public class SimpleHostManager
29 - extends AbstractProviderBroker<HostProvider, HostProviderService> 29 + extends AbstractProviderRegistry<HostProvider, HostProviderService>
30 - implements HostProviderBroker { 30 + implements HostProviderRegistry {
31 31
32 private final Logger log = getLogger(getClass()); 32 private final Logger log = getLogger(getClass());
33 33
34 - private final AbstractListenerManager<HostEvent, HostListener> 34 + private final AbstractListenerRegistry<HostEvent, HostListener>
35 - listenerManager = new AbstractListenerManager<>(); 35 + listenerRegistry = new AbstractListenerRegistry<>();
36 36
37 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 37 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
38 - private EventDispatchService eventDispatcher; 38 + private EventDeliveryService eventDispatcher;
39 39
40 40
41 @Activate 41 @Activate
42 public void activate() { 42 public void activate() {
43 - eventDispatcher.addSink(HostEvent.class, listenerManager); 43 + eventDispatcher.addSink(HostEvent.class, listenerRegistry);
44 log.info("Started"); 44 log.info("Started");
45 } 45 }
46 46
......
...@@ -6,15 +6,15 @@ import org.apache.felix.scr.annotations.Deactivate; ...@@ -6,15 +6,15 @@ import org.apache.felix.scr.annotations.Deactivate;
6 import org.apache.felix.scr.annotations.Reference; 6 import org.apache.felix.scr.annotations.Reference;
7 import org.apache.felix.scr.annotations.ReferenceCardinality; 7 import org.apache.felix.scr.annotations.ReferenceCardinality;
8 import org.apache.felix.scr.annotations.Service; 8 import org.apache.felix.scr.annotations.Service;
9 -import org.onlab.onos.event.AbstractListenerManager; 9 +import org.onlab.onos.event.AbstractListenerRegistry;
10 -import org.onlab.onos.event.EventDispatchService; 10 +import org.onlab.onos.event.EventDeliveryService;
11 import org.onlab.onos.net.link.LinkDescription; 11 import org.onlab.onos.net.link.LinkDescription;
12 import org.onlab.onos.net.link.LinkEvent; 12 import org.onlab.onos.net.link.LinkEvent;
13 import org.onlab.onos.net.link.LinkListener; 13 import org.onlab.onos.net.link.LinkListener;
14 import org.onlab.onos.net.link.LinkProvider; 14 import org.onlab.onos.net.link.LinkProvider;
15 -import org.onlab.onos.net.link.LinkProviderBroker; 15 +import org.onlab.onos.net.link.LinkProviderRegistry;
16 import org.onlab.onos.net.link.LinkProviderService; 16 import org.onlab.onos.net.link.LinkProviderService;
17 -import org.onlab.onos.net.provider.AbstractProviderBroker; 17 +import org.onlab.onos.net.provider.AbstractProviderRegistry;
18 import org.onlab.onos.net.provider.AbstractProviderService; 18 import org.onlab.onos.net.provider.AbstractProviderService;
19 import org.slf4j.Logger; 19 import org.slf4j.Logger;
20 20
...@@ -26,20 +26,20 @@ import static org.slf4j.LoggerFactory.getLogger; ...@@ -26,20 +26,20 @@ import static org.slf4j.LoggerFactory.getLogger;
26 @Component(immediate = true) 26 @Component(immediate = true)
27 @Service 27 @Service
28 public class SimpleLinkManager 28 public class SimpleLinkManager
29 - extends AbstractProviderBroker<LinkProvider, LinkProviderService> 29 + extends AbstractProviderRegistry<LinkProvider, LinkProviderService>
30 - implements LinkProviderBroker { 30 + implements LinkProviderRegistry {
31 31
32 private final Logger log = getLogger(getClass()); 32 private final Logger log = getLogger(getClass());
33 33
34 - private final AbstractListenerManager<LinkEvent, LinkListener> 34 + private final AbstractListenerRegistry<LinkEvent, LinkListener>
35 - listenerManager = new AbstractListenerManager<>(); 35 + listenerRegistry = new AbstractListenerRegistry<>();
36 36
37 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 37 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
38 - private EventDispatchService eventDispatcher; 38 + private EventDeliveryService eventDispatcher;
39 39
40 @Activate 40 @Activate
41 public void activate() { 41 public void activate() {
42 - eventDispatcher.addSink(LinkEvent.class, listenerManager); 42 + eventDispatcher.addSink(LinkEvent.class, listenerRegistry);
43 log.info("Started"); 43 log.info("Started");
44 } 44 }
45 45
......
...@@ -8,7 +8,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality; ...@@ -8,7 +8,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality;
8 import org.onlab.onos.net.Device; 8 import org.onlab.onos.net.Device;
9 import org.onlab.onos.net.MastershipRole; 9 import org.onlab.onos.net.MastershipRole;
10 import org.onlab.onos.net.device.DeviceProvider; 10 import org.onlab.onos.net.device.DeviceProvider;
11 -import org.onlab.onos.net.device.DeviceProviderBroker; 11 +import org.onlab.onos.net.device.DeviceProviderRegistry;
12 import org.onlab.onos.net.device.DeviceProviderService; 12 import org.onlab.onos.net.device.DeviceProviderService;
13 import org.onlab.onos.net.provider.AbstractProvider; 13 import org.onlab.onos.net.provider.AbstractProvider;
14 import org.onlab.onos.net.provider.ProviderId; 14 import org.onlab.onos.net.provider.ProviderId;
...@@ -27,7 +27,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -27,7 +27,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
27 private final Logger log = getLogger(getClass()); 27 private final Logger log = getLogger(getClass());
28 28
29 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 29 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
30 - protected DeviceProviderBroker providerBroker; 30 + protected DeviceProviderRegistry providerRegistry;
31 31
32 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 32 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
33 protected OpenFlowController controller; 33 protected OpenFlowController controller;
...@@ -43,13 +43,13 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr ...@@ -43,13 +43,13 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
43 43
44 @Activate 44 @Activate
45 public void activate() { 45 public void activate() {
46 - providerService = providerBroker.register(this); 46 + providerService = providerRegistry.register(this);
47 log.info("Started"); 47 log.info("Started");
48 } 48 }
49 49
50 @Deactivate 50 @Deactivate
51 public void deactivate() { 51 public void deactivate() {
52 - providerBroker.unregister(this); 52 + providerRegistry.unregister(this);
53 providerService = null; 53 providerService = null;
54 log.info("Stopped"); 54 log.info("Stopped");
55 } 55 }
......
...@@ -7,7 +7,7 @@ import org.apache.felix.scr.annotations.Reference; ...@@ -7,7 +7,7 @@ import org.apache.felix.scr.annotations.Reference;
7 import org.apache.felix.scr.annotations.ReferenceCardinality; 7 import org.apache.felix.scr.annotations.ReferenceCardinality;
8 import org.onlab.onos.net.Host; 8 import org.onlab.onos.net.Host;
9 import org.onlab.onos.net.host.HostProvider; 9 import org.onlab.onos.net.host.HostProvider;
10 -import org.onlab.onos.net.host.HostProviderBroker; 10 +import org.onlab.onos.net.host.HostProviderRegistry;
11 import org.onlab.onos.net.host.HostProviderService; 11 import org.onlab.onos.net.host.HostProviderService;
12 import org.onlab.onos.net.provider.AbstractProvider; 12 import org.onlab.onos.net.provider.AbstractProvider;
13 import org.onlab.onos.net.provider.ProviderId; 13 import org.onlab.onos.net.provider.ProviderId;
...@@ -26,7 +26,7 @@ public class OpenFlowHostProvider extends AbstractProvider implements HostProvid ...@@ -26,7 +26,7 @@ public class OpenFlowHostProvider extends AbstractProvider implements HostProvid
26 private final Logger log = getLogger(getClass()); 26 private final Logger log = getLogger(getClass());
27 27
28 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 28 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
29 - protected HostProviderBroker providerBroker; 29 + protected HostProviderRegistry providerRegistry;
30 30
31 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 31 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
32 protected OpenFlowController controller; 32 protected OpenFlowController controller;
...@@ -42,13 +42,13 @@ public class OpenFlowHostProvider extends AbstractProvider implements HostProvid ...@@ -42,13 +42,13 @@ public class OpenFlowHostProvider extends AbstractProvider implements HostProvid
42 42
43 @Activate 43 @Activate
44 public void activate() { 44 public void activate() {
45 - providerService = providerBroker.register(this); 45 + providerService = providerRegistry.register(this);
46 log.info("Started"); 46 log.info("Started");
47 } 47 }
48 48
49 @Deactivate 49 @Deactivate
50 public void deactivate() { 50 public void deactivate() {
51 - providerBroker.unregister(this); 51 + providerRegistry.unregister(this);
52 providerService = null; 52 providerService = null;
53 log.info("Stopped"); 53 log.info("Stopped");
54 } 54 }
......
...@@ -6,7 +6,7 @@ import org.apache.felix.scr.annotations.Deactivate; ...@@ -6,7 +6,7 @@ import org.apache.felix.scr.annotations.Deactivate;
6 import org.apache.felix.scr.annotations.Reference; 6 import org.apache.felix.scr.annotations.Reference;
7 import org.apache.felix.scr.annotations.ReferenceCardinality; 7 import org.apache.felix.scr.annotations.ReferenceCardinality;
8 import org.onlab.onos.net.link.LinkProvider; 8 import org.onlab.onos.net.link.LinkProvider;
9 -import org.onlab.onos.net.link.LinkProviderBroker; 9 +import org.onlab.onos.net.link.LinkProviderRegistry;
10 import org.onlab.onos.net.link.LinkProviderService; 10 import org.onlab.onos.net.link.LinkProviderService;
11 import org.onlab.onos.net.provider.AbstractProvider; 11 import org.onlab.onos.net.provider.AbstractProvider;
12 import org.onlab.onos.net.provider.ProviderId; 12 import org.onlab.onos.net.provider.ProviderId;
...@@ -25,7 +25,7 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid ...@@ -25,7 +25,7 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid
25 private final Logger log = getLogger(getClass()); 25 private final Logger log = getLogger(getClass());
26 26
27 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 27 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
28 - protected LinkProviderBroker providerBroker; 28 + protected LinkProviderRegistry providerRegistry;
29 29
30 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) 30 @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
31 protected OpenFlowController controller; 31 protected OpenFlowController controller;
...@@ -41,13 +41,13 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid ...@@ -41,13 +41,13 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid
41 41
42 @Activate 42 @Activate
43 public void activate() { 43 public void activate() {
44 - providerService = providerBroker.register(this); 44 + providerService = providerRegistry.register(this);
45 log.info("Started"); 45 log.info("Started");
46 } 46 }
47 47
48 @Deactivate 48 @Deactivate
49 public void deactivate() { 49 public void deactivate() {
50 - providerBroker.unregister(this); 50 + providerRegistry.unregister(this);
51 providerService = null; 51 providerService = null;
52 log.info("Stopped"); 52 log.info("Stopped");
53 } 53 }
......