X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fprotocol_plugins%2Fopenflow%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fprotocol_plugin%2Fopenflow%2Finternal%2FOFStatisticsManager.java;h=3ab38cc41f6db686b273864801c238f3cb36eb11;hb=dfa4383b0b5c9c6de340526a62aef731922fa29f;hp=bae49d511a2f853f61d428f0751ea7b231539831;hpb=fa52e9399f9687c7290ed98b22b00cdce4a6aacd;p=controller.git diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java index bae49d511a..3ab38cc41f 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java @@ -36,6 +36,7 @@ import org.opendaylight.controller.protocol_plugin.openflow.core.ISwitch; import org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6extension.V6Match; import org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6extension.V6StatsReply; import org.opendaylight.controller.protocol_plugin.openflow.vendorextension.v6extension.V6StatsRequest; +import org.opendaylight.controller.sal.connection.IPluginOutConnectionService; import org.opendaylight.controller.sal.core.Node; import org.opendaylight.controller.sal.core.NodeConnector; import org.opendaylight.controller.sal.core.Property; @@ -97,7 +98,7 @@ IInventoryShimExternalListener, CommandProvider { private ConcurrentMap switchSupportsVendorExtStats; // Per port sampled (every portStatsPeriod) transmit rate private Map> txRates; - private Set statisticsListeners; + private Set statisticsListeners = new CopyOnWriteArraySet(); /** * The object containing the latest factoredSamples tx rate samples for a @@ -169,6 +170,18 @@ IInventoryShimExternalListener, CommandProvider { } return statsQueueSize; } + + IPluginOutConnectionService connectionPluginOutService; + void setIPluginOutConnectionService(IPluginOutConnectionService s) { + connectionPluginOutService = s; + } + + void unsetIPluginOutConnectionService(IPluginOutConnectionService s) { + if (connectionPluginOutService == s) { + connectionPluginOutService = null; + } + } + /** * Function called by the dependency manager when all the required * dependencies are satisfied @@ -185,12 +198,11 @@ IInventoryShimExternalListener, CommandProvider { switchPortStatsUpdated = new LinkedBlockingQueue(INITIAL_SIZE); switchSupportsVendorExtStats = new ConcurrentHashMap(INITIAL_SIZE); txRates = new HashMap>(INITIAL_SIZE); - statisticsListeners = new CopyOnWriteArraySet(); configStatsPollIntervals(); // Initialize managed timers - statisticsTimer = new Timer(); + statisticsTimer = new Timer("Statistics Timer Ticks"); statisticsTimerTask = new TimerTask() { @Override public void run() { @@ -209,6 +221,7 @@ IInventoryShimExternalListener, CommandProvider { } catch (InterruptedException e) { log.warn("Flow Statistics Collector thread " + "interrupted", e); + return; } } } @@ -224,6 +237,7 @@ IInventoryShimExternalListener, CommandProvider { updatePortsTxRate(switchId); } catch (InterruptedException e) { log.warn("TX Rate Updater thread interrupted", e); + return; } } } @@ -237,6 +251,7 @@ IInventoryShimExternalListener, CommandProvider { * */ void destroy() { + statisticsListeners.clear(); } /**