OpenFlow: use same timer throughout all component lifetime
Calls to the modified methods (all configuration changes through the
CLI, for example) of OpenFlowDeviceProvider and OpenFlowRuleProvider
cause a switch from executor to another one on PortStatsCollector and
FlowStats collector respectively.
Since these Collectors are constructed with a Timer argument, we might
as well use those timers properly right away.
Change-Id: I32aa8c89d9615ea065e5fd9fd7dfc70da96b9739
diff --git a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java
index 02d9d9b..15cab14 100644
--- a/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java
+++ b/providers/openflow/device/src/main/java/org/onosproject/provider/of/device/impl/PortStatsCollector.java
@@ -16,7 +16,6 @@
package org.onosproject.provider.of.device.impl;
-import org.onlab.util.SharedExecutors;
import org.onosproject.openflow.controller.OpenFlowSwitch;
import org.onosproject.openflow.controller.RoleState;
import org.projectfloodlight.openflow.protocol.OFPortStatsRequest;
@@ -73,8 +72,8 @@
public synchronized void start() {
log.info("Starting Port Stats collection thread for {}", sw.getStringId());
task = new InternalTimerTask();
- SharedExecutors.getTimer().scheduleAtFixedRate(task, 1 * SECONDS,
- refreshInterval * SECONDS);
+ timer.scheduleAtFixedRate(task, 1 * SECONDS,
+ refreshInterval * SECONDS);
}
/**