Experimenting with Apache 2 copyright on the onos-cli module. More later...
diff --git a/core/api/src/main/java/org/onlab/onos/event/AbstractListenerRegistry.java b/core/api/src/main/java/org/onlab/onos/event/AbstractListenerRegistry.java
index 9710306..95581e3 100644
--- a/core/api/src/main/java/org/onlab/onos/event/AbstractListenerRegistry.java
+++ b/core/api/src/main/java/org/onlab/onos/event/AbstractListenerRegistry.java
@@ -19,6 +19,7 @@
private final Logger log = getLogger(getClass());
private final Set<L> listeners = new CopyOnWriteArraySet<>();
+ private volatile boolean shutdown = false;
/**
* Adds the specified listener.
@@ -58,7 +59,24 @@
* @param error error encountered while processing
*/
protected void reportProblem(E event, Throwable error) {
- log.warn("Exception encountered while processing event " + event, error);
+ if (!shutdown) {
+ log.warn("Exception encountered while processing event " + event, error);
+ }
}
+ /**
+ * Prepares the registry for normal operation.
+ */
+ public void activate() {
+ shutdown = false;
+ }
+
+ /**
+ * Prepares the registry for shutdown.
+ */
+ public void deactivate() {
+ shutdown = true;
+ }
+
+
}