Adding some base-classes to eliminate event and listener boiler-plate code throughout a number of subsystems.
Refactored all core components to take advantage of this; apps remain to be done.
Change-Id: Ib0935ba07ff81b0fa032534004ec9ac6187cbf22
diff --git a/core/api/src/main/java/org/onosproject/net/intent/PartitionService.java b/core/api/src/main/java/org/onosproject/net/intent/PartitionService.java
index 7c9d547..02cccca 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/PartitionService.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/PartitionService.java
@@ -17,12 +17,14 @@
import com.google.common.annotations.Beta;
import org.onosproject.cluster.NodeId;
+import org.onosproject.event.ListenerService;
/**
* Service for interacting with the partition-to-instance assignments.
*/
@Beta
-public interface PartitionService {
+public interface PartitionService
+ extends ListenerService<PartitionEvent, PartitionEventListener> {
/**
* Returns whether the given intent key is in a partition owned by this
@@ -43,17 +45,4 @@
// TODO add API for rebalancing partitions
- /**
- * Registers a event listener to be notified of partition events.
- *
- * @param listener listener that will asynchronously notified of partition events.
- */
- void addListener(PartitionEventListener listener);
-
- /**
- * Unregisters a event listener for partition events.
- *
- * @param listener listener to be removed.
- */
- void removeListener(PartitionEventListener listener);
}