Toggle navigation
Toggle navigation
This project
Loading...
Sign in
홍길동
/
onos
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
tom
2014-08-28 09:26:03 -0700
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
96dfcab1a110855fc2194f012f788e4ca49d0fe6
96dfcab1
1 parent
7a9bcbe9
Changed nomenclature from Broker to Registry.
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
102 additions
and
102 deletions
net/api/src/main/java/org/onlab/onos/event/AbstractEvent.java
net/api/src/main/java/org/onlab/onos/event/AbstractListenerManager.java → net/api/src/main/java/org/onlab/onos/event/AbstractListenerRegistry.java
net/api/src/main/java/org/onlab/onos/event/DefaultEventSinkBroker.java → net/api/src/main/java/org/onlab/onos/event/DefaultEventSinkRegistry.java
net/api/src/main/java/org/onlab/onos/event/Event.java
net/api/src/main/java/org/onlab/onos/event/EventDispatchService.java → net/api/src/main/java/org/onlab/onos/event/EventDeliveryService.java
net/api/src/main/java/org/onlab/onos/event/EventSinkBroker.java → net/api/src/main/java/org/onlab/onos/event/EventSinkRegistry.java
net/api/src/main/java/org/onlab/onos/net/device/DeviceProviderBroker.java → net/api/src/main/java/org/onlab/onos/net/device/DeviceProviderRegistry.java
net/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProviderBroker.java → net/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProviderRegistry.java
net/api/src/main/java/org/onlab/onos/net/host/HostProviderBroker.java → net/api/src/main/java/org/onlab/onos/net/host/HostProviderRegistry.java
net/api/src/main/java/org/onlab/onos/net/link/LinkProviderBroker.java → net/api/src/main/java/org/onlab/onos/net/link/LinkProviderRegistry.java
net/api/src/main/java/org/onlab/onos/net/provider/AbstractProviderBroker.java → net/api/src/main/java/org/onlab/onos/net/provider/AbstractProviderRegistry.java
net/api/src/main/java/org/onlab/onos/net/provider/ProviderBroker.java → net/api/src/main/java/org/onlab/onos/net/provider/ProviderRegistry.java
net/api/src/main/java/org/onlab/onos/net/topology/TopologyProviderBroker.java → net/api/src/main/java/org/onlab/onos/net/topology/TopologyProviderRegistry.java
net/api/src/test/java/org/onlab/onos/event/AbstractListenerManagerTest.java → net/api/src/test/java/org/onlab/onos/event/AbstractListenerRegistryTest.java
net/api/src/test/java/org/onlab/onos/event/DefaultEventSinkBrokerTest.java → net/api/src/test/java/org/onlab/onos/event/DefaultEventSinkRegistryTest.java
net/api/src/test/java/org/onlab/onos/event/TestListenerManager.java → net/api/src/test/java/org/onlab/onos/event/TestListenerRegistry.java
net/core/trivial/src/main/java/org/onlab/onos/event/impl/SimpleEventDispatcher.java
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleDeviceManager.java
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleHostManager.java
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleLinkManager.java
providers/of/device/src/main/java/org/onlab/onos/provider/of/device/impl/OpenFlowDeviceProvider.java
providers/of/host/src/main/java/org/onlab/onos/provider/of/host/impl/OpenFlowHostProvider.java
providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
net/api/src/main/java/org/onlab/onos/event/AbstractEvent.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
event
;
/**
* Base
abstraction of an event
.
* Base
event implementation
.
*/
public
class
AbstractEvent
<
T
extends
Enum
,
S
extends
Object
>
implements
Event
<
T
,
S
>
{
...
...
net/api/src/main/java/org/onlab/onos/event/AbstractListener
Manager
.java
→
net/api/src/main/java/org/onlab/onos/event/AbstractListener
Registry
.java
View file @
96dfcab
...
...
@@ -10,10 +10,10 @@ import static com.google.common.base.Preconditions.checkNotNull;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
/**
* Base implementation of a
manager capable of tracking listeners and
*
dispatching events to them
.
* Base implementation of a
n event sink and a registry capable of tracking
*
listeners and dispatching events to them as part of event sink processing
.
*/
public
class
AbstractListener
Manager
<
E
extends
Event
,
L
extends
EventListener
<
E
>>
public
class
AbstractListener
Registry
<
E
extends
Event
,
L
extends
EventListener
<
E
>>
implements
EventSink
<
E
>
{
private
final
Logger
log
=
getLogger
(
getClass
());
...
...
net/api/src/main/java/org/onlab/onos/event/DefaultEventSink
Broker
.java
→
net/api/src/main/java/org/onlab/onos/event/DefaultEventSink
Registry
.java
View file @
96dfcab
...
...
@@ -10,12 +10,12 @@ import static com.google.common.base.Preconditions.checkArgument;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
/**
* Base implementation of event sink
broker
.
* Base implementation of event sink
registry
.
*/
public
class
DefaultEventSink
Broker
implements
EventSinkBroker
{
public
class
DefaultEventSink
Registry
implements
EventSinkRegistry
{
private
final
Map
<
Class
<?
extends
Event
>,
EventSink
<?
extends
Event
>>
sinks
=
new
ConcurrentHashMap
<>();
private
final
Map
<
Class
<?
extends
Event
>,
EventSink
<?
extends
Event
>>
sinks
=
new
ConcurrentHashMap
<>();
@Override
public
<
E
extends
Event
>
void
addSink
(
Class
<
E
>
eventClass
,
EventSink
<
E
>
sink
)
{
...
...
net/api/src/main/java/org/onlab/onos/event/Event.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
event
;
/**
* Abstraction of an
even
t.
* Abstraction of an
of a time-stamped event pertaining to an arbitrary subjec
t.
*/
public
interface
Event
<
T
extends
Enum
,
S
extends
Object
>
{
...
...
net/api/src/main/java/org/onlab/onos/event/EventD
ispatch
Service.java
→
net/api/src/main/java/org/onlab/onos/event/EventD
elivery
Service.java
View file @
96dfcab
...
...
@@ -4,5 +4,5 @@ package org.onlab.onos.event;
* Abstraction of an entity capable of accepting events to be posted and
* then dispatching them to the appropriate event sink.
*/
public
interface
EventD
ispatchService
extends
EventDispatcher
,
EventSinkBroker
{
public
interface
EventD
eliveryService
extends
EventDispatcher
,
EventSinkRegistry
{
}
...
...
net/api/src/main/java/org/onlab/onos/event/EventSink
Broker
.java
→
net/api/src/main/java/org/onlab/onos/event/EventSink
Registry
.java
View file @
96dfcab
...
...
@@ -3,10 +3,10 @@ package org.onlab.onos.event;
import
java.util.Set
;
/**
* Abstraction of an event sink
broker
capable of tracking sinks based on
* Abstraction of an event sink
registry
capable of tracking sinks based on
* their event class.
*/
public
interface
EventSink
Broker
{
public
interface
EventSink
Registry
{
/**
* Adds the specified sink for the given event class.
...
...
net/api/src/main/java/org/onlab/onos/net/device/DeviceProvider
Broker
.java
→
net/api/src/main/java/org/onlab/onos/net/device/DeviceProvider
Registry
.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
net
.
device
;
import
org.onlab.onos.net.provider.Provider
Broker
;
import
org.onlab.onos.net.provider.Provider
Registry
;
/**
* Abstraction of a device provider
brokerage
.
* Abstraction of a device provider
registry
.
*/
public
interface
DeviceProvider
Broker
extends
Provider
Broker
<
DeviceProvider
,
DeviceProviderService
>
{
public
interface
DeviceProvider
Registry
extends
Provider
Registry
<
DeviceProvider
,
DeviceProviderService
>
{
}
...
...
net/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProvider
Broker
.java
→
net/api/src/main/java/org/onlab/onos/net/flow/FlowRuleProvider
Registry
.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
net
.
flow
;
import
org.onlab.onos.net.provider.Provider
Broker
;
import
org.onlab.onos.net.provider.Provider
Registry
;
/**
* Abstraction for a flow rule provider
brokerage
.
* Abstraction for a flow rule provider
registry
.
*/
public
interface
FlowRuleProvider
Broker
extends
Provider
Broker
<
FlowRuleProvider
,
FlowRuleProviderService
>
{
public
interface
FlowRuleProvider
Registry
extends
Provider
Registry
<
FlowRuleProvider
,
FlowRuleProviderService
>
{
}
...
...
net/api/src/main/java/org/onlab/onos/net/host/HostProvider
Broker
.java
→
net/api/src/main/java/org/onlab/onos/net/host/HostProvider
Registry
.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
net
.
host
;
import
org.onlab.onos.net.provider.Provider
Broker
;
import
org.onlab.onos.net.provider.Provider
Registry
;
/**
* Abstraction of a host provider
brokerage
.
* Abstraction of a host provider
registry
.
*/
public
interface
HostProvider
Broker
extends
Provider
Broker
<
HostProvider
,
HostProviderService
>
{
public
interface
HostProvider
Registry
extends
Provider
Registry
<
HostProvider
,
HostProviderService
>
{
}
...
...
net/api/src/main/java/org/onlab/onos/net/link/LinkProvider
Broker
.java
→
net/api/src/main/java/org/onlab/onos/net/link/LinkProvider
Registry
.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
net
.
link
;
import
org.onlab.onos.net.provider.Provider
Broker
;
import
org.onlab.onos.net.provider.Provider
Registry
;
/**
* Abstraction of an infrastructure link provider
brokerage
.
* Abstraction of an infrastructure link provider
registry
.
*/
public
interface
LinkProvider
Broker
extends
Provider
Broker
<
LinkProvider
,
LinkProviderService
>
{
public
interface
LinkProvider
Registry
extends
Provider
Registry
<
LinkProvider
,
LinkProviderService
>
{
}
...
...
net/api/src/main/java/org/onlab/onos/net/provider/AbstractProvider
Broker
.java
→
net/api/src/main/java/org/onlab/onos/net/provider/AbstractProvider
Registry
.java
View file @
96dfcab
...
...
@@ -7,13 +7,13 @@ import static com.google.common.base.Preconditions.checkArgument;
import
static
com
.
google
.
common
.
base
.
Preconditions
.
checkNotNull
;
/**
* Base implementation of provider
broker
.
* Base implementation of provider
registry
.
*
* @param <P> type of the information provider
* @param <S> type of the provider service
*/
public
abstract
class
AbstractProvider
Broker
<
P
extends
Provider
,
S
extends
ProviderService
<
P
>>
implements
Provider
Broker
<
P
,
S
>
{
public
abstract
class
AbstractProvider
Registry
<
P
extends
Provider
,
S
extends
ProviderService
<
P
>>
implements
Provider
Registry
<
P
,
S
>
{
private
final
Map
<
ProviderId
,
S
>
services
=
new
HashMap
<>();
...
...
net/api/src/main/java/org/onlab/onos/net/provider/Provider
Broker
.java
→
net/api/src/main/java/org/onlab/onos/net/provider/Provider
Registry
.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
net
.
provider
;
/**
*
Broker used for registering/unregister
ing information providers with the core.
*
Registry for track
ing information providers with the core.
*
* @param <P> type of the information provider
* @param <S> type of the provider service
*/
public
interface
Provider
Broker
<
P
extends
Provider
,
S
extends
ProviderService
<
P
>>
{
public
interface
Provider
Registry
<
P
extends
Provider
,
S
extends
ProviderService
<
P
>>
{
/**
* Registers the supplied provider with the core.
...
...
net/api/src/main/java/org/onlab/onos/net/topology/TopologyProvider
Broker
.java
→
net/api/src/main/java/org/onlab/onos/net/topology/TopologyProvider
Registry
.java
View file @
96dfcab
package
org
.
onlab
.
onos
.
net
.
topology
;
import
org.onlab.onos.net.provider.Provider
Broker
;
import
org.onlab.onos.net.provider.Provider
Registry
;
/**
* Abstraction of a network topology provider
brokerage
.
* Abstraction of a network topology provider
registry
.
*/
public
interface
TopologyProvider
Broker
extends
Provider
Broker
<
TopologyProvider
,
TopologyProviderService
>
{
public
interface
TopologyProvider
Registry
extends
Provider
Registry
<
TopologyProvider
,
TopologyProviderService
>
{
}
...
...
net/api/src/test/java/org/onlab/onos/event/AbstractListener
Manager
Test.java
→
net/api/src/test/java/org/onlab/onos/event/AbstractListener
Registry
Test.java
View file @
96dfcab
...
...
@@ -8,13 +8,13 @@ import static org.junit.Assert.assertTrue;
/**
* Tests of the base listener manager.
*/
public
class
AbstractListener
Manager
Test
{
public
class
AbstractListener
Registry
Test
{
@Test
public
void
basics
()
{
TestListener
listener
=
new
TestListener
();
TestListener
secondListener
=
new
TestListener
();
TestListener
Manager
manager
=
new
TestListenerManager
();
TestListener
Registry
manager
=
new
TestListenerRegistry
();
manager
.
addListener
(
listener
);
manager
.
addListener
(
secondListener
);
...
...
@@ -35,7 +35,7 @@ public class AbstractListenerManagerTest {
public
void
badListener
()
{
TestListener
listener
=
new
BrokenListener
();
TestListener
secondListener
=
new
TestListener
();
TestListener
Manager
manager
=
new
TestListenerManager
();
TestListener
Registry
manager
=
new
TestListenerRegistry
();
manager
.
addListener
(
listener
);
manager
.
addListener
(
secondListener
);
...
...
net/api/src/test/java/org/onlab/onos/event/DefaultEventSink
Broker
Test.java
→
net/api/src/test/java/org/onlab/onos/event/DefaultEventSink
Registry
Test.java
View file @
96dfcab
...
...
@@ -6,11 +6,11 @@ import org.junit.Test;
import
static
org
.
junit
.
Assert
.*;
/**
* Tests of the default event sink
broker
.
* Tests of the default event sink
registry
.
*/
public
class
DefaultEventSink
Broker
Test
{
public
class
DefaultEventSink
Registry
Test
{
private
DefaultEventSink
Broker
broker
;
private
DefaultEventSink
Registry
registry
;
private
static
class
FooEvent
extends
TestEvent
{
public
FooEvent
(
String
subject
)
{
super
(
Type
.
FOO
,
subject
);
}
...
...
@@ -30,23 +30,23 @@ public class DefaultEventSinkBrokerTest {
@Before
public
void
setUp
()
{
broker
=
new
DefaultEventSinkBroker
();
registry
=
new
DefaultEventSinkRegistry
();
}
@Test
public
void
basics
()
{
FooSink
fooSink
=
new
FooSink
();
BarSink
barSink
=
new
BarSink
();
broker
.
addSink
(
FooEvent
.
class
,
fooSink
);
broker
.
addSink
(
BarEvent
.
class
,
barSink
);
registry
.
addSink
(
FooEvent
.
class
,
fooSink
);
registry
.
addSink
(
BarEvent
.
class
,
barSink
);
assertEquals
(
"incorrect sink count"
,
2
,
broker
.
getSinks
().
size
());
assertEquals
(
"incorrect sink"
,
fooSink
,
broker
.
getSink
(
FooEvent
.
class
));
assertEquals
(
"incorrect sink"
,
barSink
,
broker
.
getSink
(
BarEvent
.
class
));
assertEquals
(
"incorrect sink count"
,
2
,
registry
.
getSinks
().
size
());
assertEquals
(
"incorrect sink"
,
fooSink
,
registry
.
getSink
(
FooEvent
.
class
));
assertEquals
(
"incorrect sink"
,
barSink
,
registry
.
getSink
(
BarEvent
.
class
));
broker
.
removeSink
(
FooEvent
.
class
);
assertNull
(
"incorrect sink"
,
broker
.
getSink
(
FooEvent
.
class
));
assertEquals
(
"incorrect sink"
,
barSink
,
broker
.
getSink
(
BarEvent
.
class
));
registry
.
removeSink
(
FooEvent
.
class
);
assertNull
(
"incorrect sink"
,
registry
.
getSink
(
FooEvent
.
class
));
assertEquals
(
"incorrect sink"
,
barSink
,
registry
.
getSink
(
BarEvent
.
class
));
}
}
...
...
net/api/src/test/java/org/onlab/onos/event/TestListener
Manager
.java
→
net/api/src/test/java/org/onlab/onos/event/TestListener
Registry
.java
View file @
96dfcab
...
...
@@ -6,8 +6,8 @@ import java.util.List;
/**
* Test event listener manager fixture.
*/
public
class
TestListener
Manager
extends
AbstractListener
Manager
<
TestEvent
,
TestListener
>
{
public
class
TestListener
Registry
extends
AbstractListener
Registry
<
TestEvent
,
TestListener
>
{
public
final
List
<
Throwable
>
errors
=
new
ArrayList
<>();
...
...
net/core/trivial/src/main/java/org/onlab/onos/event/impl/SimpleEventDispatcher.java
View file @
96dfcab
...
...
@@ -5,9 +5,9 @@ import org.apache.felix.scr.annotations.Component;
import
org.apache.felix.scr.annotations.Deactivate
;
import
org.apache.felix.scr.annotations.Service
;
import
org.onlab.onos.event.AbstractEvent
;
import
org.onlab.onos.event.DefaultEventSink
Broker
;
import
org.onlab.onos.event.DefaultEventSink
Registry
;
import
org.onlab.onos.event.Event
;
import
org.onlab.onos.event.EventD
ispatch
Service
;
import
org.onlab.onos.event.EventD
elivery
Service
;
import
org.onlab.onos.event.EventSink
;
import
org.slf4j.Logger
;
...
...
@@ -24,8 +24,8 @@ import static org.slf4j.LoggerFactory.getLogger;
*/
@Component
(
immediate
=
true
)
@Service
public
class
SimpleEventDispatcher
extends
DefaultEventSink
Broker
implements
EventD
ispatch
Service
{
public
class
SimpleEventDispatcher
extends
DefaultEventSink
Registry
implements
EventD
elivery
Service
{
private
final
Logger
log
=
getLogger
(
getClass
());
...
...
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleDeviceManager.java
View file @
96dfcab
...
...
@@ -6,8 +6,8 @@ import org.apache.felix.scr.annotations.Deactivate;
import
org.apache.felix.scr.annotations.Reference
;
import
org.apache.felix.scr.annotations.ReferenceCardinality
;
import
org.apache.felix.scr.annotations.Service
;
import
org.onlab.onos.event.AbstractListener
Manager
;
import
org.onlab.onos.event.EventD
ispatch
Service
;
import
org.onlab.onos.event.AbstractListener
Registry
;
import
org.onlab.onos.event.EventD
elivery
Service
;
import
org.onlab.onos.net.Device
;
import
org.onlab.onos.net.DeviceId
;
import
org.onlab.onos.net.MastershipRole
;
...
...
@@ -17,11 +17,11 @@ import org.onlab.onos.net.device.DeviceDescription;
import
org.onlab.onos.net.device.DeviceEvent
;
import
org.onlab.onos.net.device.DeviceListener
;
import
org.onlab.onos.net.device.DeviceProvider
;
import
org.onlab.onos.net.device.DeviceProvider
Broker
;
import
org.onlab.onos.net.device.DeviceProvider
Registry
;
import
org.onlab.onos.net.device.DeviceProviderService
;
import
org.onlab.onos.net.device.DeviceService
;
import
org.onlab.onos.net.device.PortDescription
;
import
org.onlab.onos.net.provider.AbstractProvider
Broker
;
import
org.onlab.onos.net.provider.AbstractProvider
Registry
;
import
org.onlab.onos.net.provider.AbstractProviderService
;
import
org.slf4j.Logger
;
...
...
@@ -36,8 +36,8 @@ import static org.slf4j.LoggerFactory.getLogger;
@Component
(
immediate
=
true
)
@Service
public
class
SimpleDeviceManager
extends
AbstractProvider
Broker
<
DeviceProvider
,
DeviceProviderService
>
implements
DeviceService
,
DeviceProvider
Broker
{
extends
AbstractProvider
Registry
<
DeviceProvider
,
DeviceProviderService
>
implements
DeviceService
,
DeviceProvider
Registry
{
public
static
final
String
DEVICE_ID_NULL
=
"Device ID cannot be null"
;
public
static
final
String
PORT_NUMBER_NULL
=
"Port number cannot be null"
;
...
...
@@ -46,17 +46,17 @@ public class SimpleDeviceManager
private
final
Logger
log
=
getLogger
(
getClass
());
private
final
AbstractListener
Manager
<
DeviceEvent
,
DeviceListener
>
listener
Manager
=
new
AbstractListenerManager
<>();
private
final
AbstractListener
Registry
<
DeviceEvent
,
DeviceListener
>
listener
Registry
=
new
AbstractListenerRegistry
<>();
private
final
DeviceStore
store
=
new
DeviceStore
();
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
private
EventD
ispatch
Service
eventDispatcher
;
private
EventD
elivery
Service
eventDispatcher
;
@Activate
public
void
activate
()
{
eventDispatcher
.
addSink
(
DeviceEvent
.
class
,
listener
Manager
);
eventDispatcher
.
addSink
(
DeviceEvent
.
class
,
listener
Registry
);
log
.
info
(
"Started"
);
}
...
...
@@ -98,12 +98,12 @@ public class SimpleDeviceManager
@Override
public
void
addListener
(
DeviceListener
listener
)
{
listener
Manager
.
addListener
(
listener
);
listener
Registry
.
addListener
(
listener
);
}
@Override
public
void
removeListener
(
DeviceListener
listener
)
{
listener
Manager
.
removeListener
(
listener
);
listener
Registry
.
removeListener
(
listener
);
}
@Override
...
...
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleHostManager.java
View file @
96dfcab
...
...
@@ -6,15 +6,15 @@ import org.apache.felix.scr.annotations.Deactivate;
import
org.apache.felix.scr.annotations.Reference
;
import
org.apache.felix.scr.annotations.ReferenceCardinality
;
import
org.apache.felix.scr.annotations.Service
;
import
org.onlab.onos.event.AbstractListener
Manager
;
import
org.onlab.onos.event.EventD
ispatch
Service
;
import
org.onlab.onos.event.AbstractListener
Registry
;
import
org.onlab.onos.event.EventD
elivery
Service
;
import
org.onlab.onos.net.host.HostDescription
;
import
org.onlab.onos.net.host.HostEvent
;
import
org.onlab.onos.net.host.HostListener
;
import
org.onlab.onos.net.host.HostProvider
;
import
org.onlab.onos.net.host.HostProvider
Broker
;
import
org.onlab.onos.net.host.HostProvider
Registry
;
import
org.onlab.onos.net.host.HostProviderService
;
import
org.onlab.onos.net.provider.AbstractProvider
Broker
;
import
org.onlab.onos.net.provider.AbstractProvider
Registry
;
import
org.onlab.onos.net.provider.AbstractProviderService
;
import
org.slf4j.Logger
;
...
...
@@ -26,21 +26,21 @@ import static org.slf4j.LoggerFactory.getLogger;
@Component
(
immediate
=
true
)
@Service
public
class
SimpleHostManager
extends
AbstractProvider
Broker
<
HostProvider
,
HostProviderService
>
implements
HostProvider
Broker
{
extends
AbstractProvider
Registry
<
HostProvider
,
HostProviderService
>
implements
HostProvider
Registry
{
private
final
Logger
log
=
getLogger
(
getClass
());
private
final
AbstractListener
Manager
<
HostEvent
,
HostListener
>
listener
Manager
=
new
AbstractListenerManager
<>();
private
final
AbstractListener
Registry
<
HostEvent
,
HostListener
>
listener
Registry
=
new
AbstractListenerRegistry
<>();
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
private
EventD
ispatch
Service
eventDispatcher
;
private
EventD
elivery
Service
eventDispatcher
;
@Activate
public
void
activate
()
{
eventDispatcher
.
addSink
(
HostEvent
.
class
,
listener
Manager
);
eventDispatcher
.
addSink
(
HostEvent
.
class
,
listener
Registry
);
log
.
info
(
"Started"
);
}
...
...
net/core/trivial/src/main/java/org/onlab/onos/net/trivial/impl/SimpleLinkManager.java
View file @
96dfcab
...
...
@@ -6,15 +6,15 @@ import org.apache.felix.scr.annotations.Deactivate;
import
org.apache.felix.scr.annotations.Reference
;
import
org.apache.felix.scr.annotations.ReferenceCardinality
;
import
org.apache.felix.scr.annotations.Service
;
import
org.onlab.onos.event.AbstractListener
Manager
;
import
org.onlab.onos.event.EventD
ispatch
Service
;
import
org.onlab.onos.event.AbstractListener
Registry
;
import
org.onlab.onos.event.EventD
elivery
Service
;
import
org.onlab.onos.net.link.LinkDescription
;
import
org.onlab.onos.net.link.LinkEvent
;
import
org.onlab.onos.net.link.LinkListener
;
import
org.onlab.onos.net.link.LinkProvider
;
import
org.onlab.onos.net.link.LinkProvider
Broker
;
import
org.onlab.onos.net.link.LinkProvider
Registry
;
import
org.onlab.onos.net.link.LinkProviderService
;
import
org.onlab.onos.net.provider.AbstractProvider
Broker
;
import
org.onlab.onos.net.provider.AbstractProvider
Registry
;
import
org.onlab.onos.net.provider.AbstractProviderService
;
import
org.slf4j.Logger
;
...
...
@@ -26,20 +26,20 @@ import static org.slf4j.LoggerFactory.getLogger;
@Component
(
immediate
=
true
)
@Service
public
class
SimpleLinkManager
extends
AbstractProvider
Broker
<
LinkProvider
,
LinkProviderService
>
implements
LinkProvider
Broker
{
extends
AbstractProvider
Registry
<
LinkProvider
,
LinkProviderService
>
implements
LinkProvider
Registry
{
private
final
Logger
log
=
getLogger
(
getClass
());
private
final
AbstractListener
Manager
<
LinkEvent
,
LinkListener
>
listener
Manager
=
new
AbstractListenerManager
<>();
private
final
AbstractListener
Registry
<
LinkEvent
,
LinkListener
>
listener
Registry
=
new
AbstractListenerRegistry
<>();
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
private
EventD
ispatch
Service
eventDispatcher
;
private
EventD
elivery
Service
eventDispatcher
;
@Activate
public
void
activate
()
{
eventDispatcher
.
addSink
(
LinkEvent
.
class
,
listener
Manager
);
eventDispatcher
.
addSink
(
LinkEvent
.
class
,
listener
Registry
);
log
.
info
(
"Started"
);
}
...
...
providers/of/device/src/main/java/org/onlab/onos/provider/of/device/impl/OpenFlowDeviceProvider.java
View file @
96dfcab
...
...
@@ -8,7 +8,7 @@ import org.apache.felix.scr.annotations.ReferenceCardinality;
import
org.onlab.onos.net.Device
;
import
org.onlab.onos.net.MastershipRole
;
import
org.onlab.onos.net.device.DeviceProvider
;
import
org.onlab.onos.net.device.DeviceProvider
Broker
;
import
org.onlab.onos.net.device.DeviceProvider
Registry
;
import
org.onlab.onos.net.device.DeviceProviderService
;
import
org.onlab.onos.net.provider.AbstractProvider
;
import
org.onlab.onos.net.provider.ProviderId
;
...
...
@@ -27,7 +27,7 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
private
final
Logger
log
=
getLogger
(
getClass
());
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
protected
DeviceProvider
Broker
providerBroker
;
protected
DeviceProvider
Registry
providerRegistry
;
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
protected
OpenFlowController
controller
;
...
...
@@ -43,13 +43,13 @@ public class OpenFlowDeviceProvider extends AbstractProvider implements DevicePr
@Activate
public
void
activate
()
{
providerService
=
provider
Broker
.
register
(
this
);
providerService
=
provider
Registry
.
register
(
this
);
log
.
info
(
"Started"
);
}
@Deactivate
public
void
deactivate
()
{
provider
Broker
.
unregister
(
this
);
provider
Registry
.
unregister
(
this
);
providerService
=
null
;
log
.
info
(
"Stopped"
);
}
...
...
providers/of/host/src/main/java/org/onlab/onos/provider/of/host/impl/OpenFlowHostProvider.java
View file @
96dfcab
...
...
@@ -7,7 +7,7 @@ import org.apache.felix.scr.annotations.Reference;
import
org.apache.felix.scr.annotations.ReferenceCardinality
;
import
org.onlab.onos.net.Host
;
import
org.onlab.onos.net.host.HostProvider
;
import
org.onlab.onos.net.host.HostProvider
Broker
;
import
org.onlab.onos.net.host.HostProvider
Registry
;
import
org.onlab.onos.net.host.HostProviderService
;
import
org.onlab.onos.net.provider.AbstractProvider
;
import
org.onlab.onos.net.provider.ProviderId
;
...
...
@@ -26,7 +26,7 @@ public class OpenFlowHostProvider extends AbstractProvider implements HostProvid
private
final
Logger
log
=
getLogger
(
getClass
());
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
protected
HostProvider
Broker
providerBroker
;
protected
HostProvider
Registry
providerRegistry
;
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
protected
OpenFlowController
controller
;
...
...
@@ -42,13 +42,13 @@ public class OpenFlowHostProvider extends AbstractProvider implements HostProvid
@Activate
public
void
activate
()
{
providerService
=
provider
Broker
.
register
(
this
);
providerService
=
provider
Registry
.
register
(
this
);
log
.
info
(
"Started"
);
}
@Deactivate
public
void
deactivate
()
{
provider
Broker
.
unregister
(
this
);
provider
Registry
.
unregister
(
this
);
providerService
=
null
;
log
.
info
(
"Stopped"
);
}
...
...
providers/of/link/src/main/java/org/onlab/onos/provider/of/link/impl/OpenFlowLinkProvider.java
View file @
96dfcab
...
...
@@ -6,7 +6,7 @@ import org.apache.felix.scr.annotations.Deactivate;
import
org.apache.felix.scr.annotations.Reference
;
import
org.apache.felix.scr.annotations.ReferenceCardinality
;
import
org.onlab.onos.net.link.LinkProvider
;
import
org.onlab.onos.net.link.LinkProvider
Broker
;
import
org.onlab.onos.net.link.LinkProvider
Registry
;
import
org.onlab.onos.net.link.LinkProviderService
;
import
org.onlab.onos.net.provider.AbstractProvider
;
import
org.onlab.onos.net.provider.ProviderId
;
...
...
@@ -25,7 +25,7 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid
private
final
Logger
log
=
getLogger
(
getClass
());
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
protected
LinkProvider
Broker
providerBroker
;
protected
LinkProvider
Registry
providerRegistry
;
@Reference
(
cardinality
=
ReferenceCardinality
.
MANDATORY_UNARY
)
protected
OpenFlowController
controller
;
...
...
@@ -41,13 +41,13 @@ public class OpenFlowLinkProvider extends AbstractProvider implements LinkProvid
@Activate
public
void
activate
()
{
providerService
=
provider
Broker
.
register
(
this
);
providerService
=
provider
Registry
.
register
(
this
);
log
.
info
(
"Started"
);
}
@Deactivate
public
void
deactivate
()
{
provider
Broker
.
unregister
(
this
);
provider
Registry
.
unregister
(
this
);
providerService
=
null
;
log
.
info
(
"Stopped"
);
}
...
...
Please
register
or
login
to post a comment