Committed by
Gerrit Code Review
[ONOS-3117] Storing listener of PortChain
Change-Id: I163c013bd6882de1d78ce611fd80cb0636b4fbf5
Showing
1 changed file
with
7 additions
and
3 deletions
| ... | @@ -27,6 +27,7 @@ import org.apache.felix.scr.annotations.Reference; | ... | @@ -27,6 +27,7 @@ import org.apache.felix.scr.annotations.Reference; |
| 27 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 27 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 28 | import org.apache.felix.scr.annotations.Service; | 28 | import org.apache.felix.scr.annotations.Service; |
| 29 | import org.onlab.util.KryoNamespace; | 29 | import org.onlab.util.KryoNamespace; |
| 30 | +import org.onosproject.event.AbstractListenerManager; | ||
| 30 | import org.onosproject.store.serializers.KryoNamespaces; | 31 | import org.onosproject.store.serializers.KryoNamespaces; |
| 31 | import org.onosproject.store.service.EventuallyConsistentMap; | 32 | import org.onosproject.store.service.EventuallyConsistentMap; |
| 32 | import org.onosproject.store.service.MultiValuedTimestamp; | 33 | import org.onosproject.store.service.MultiValuedTimestamp; |
| ... | @@ -34,6 +35,8 @@ import org.onosproject.store.service.StorageService; | ... | @@ -34,6 +35,8 @@ import org.onosproject.store.service.StorageService; |
| 34 | import org.onosproject.store.service.WallClockTimestamp; | 35 | import org.onosproject.store.service.WallClockTimestamp; |
| 35 | import org.onosproject.vtnrsc.PortChain; | 36 | import org.onosproject.vtnrsc.PortChain; |
| 36 | import org.onosproject.vtnrsc.PortChainId; | 37 | import org.onosproject.vtnrsc.PortChainId; |
| 38 | +import org.onosproject.vtnrsc.portchain.PortChainEvent; | ||
| 39 | +import org.onosproject.vtnrsc.portchain.PortChainListener; | ||
| 37 | import org.onosproject.vtnrsc.portchain.PortChainService; | 40 | import org.onosproject.vtnrsc.portchain.PortChainService; |
| 38 | import org.slf4j.Logger; | 41 | import org.slf4j.Logger; |
| 39 | 42 | ||
| ... | @@ -42,13 +45,14 @@ import org.slf4j.Logger; | ... | @@ -42,13 +45,14 @@ import org.slf4j.Logger; |
| 42 | */ | 45 | */ |
| 43 | @Component(immediate = true) | 46 | @Component(immediate = true) |
| 44 | @Service | 47 | @Service |
| 45 | -public class PortChainManager implements PortChainService { | 48 | +public class PortChainManager extends AbstractListenerManager<PortChainEvent, PortChainListener> implements |
| 46 | - | 49 | + PortChainService { |
| 47 | - private final Logger log = getLogger(getClass()); | ||
| 48 | 50 | ||
| 49 | private static final String PORT_CHAIN_ID_NULL = "PortChain ID cannot be null"; | 51 | private static final String PORT_CHAIN_ID_NULL = "PortChain ID cannot be null"; |
| 50 | private static final String PORT_CHAIN_NULL = "PortChain cannot be null"; | 52 | private static final String PORT_CHAIN_NULL = "PortChain cannot be null"; |
| 53 | + private static final String LISTENER_NOT_NULL = "Listener cannot be null"; | ||
| 51 | 54 | ||
| 55 | + private final Logger log = getLogger(getClass()); | ||
| 52 | private EventuallyConsistentMap<PortChainId, PortChain> portChainStore; | 56 | private EventuallyConsistentMap<PortChainId, PortChain> portChainStore; |
| 53 | 57 | ||
| 54 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 58 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ... | ... |
-
Please register or login to post a comment