private ConcurrentMap<FlowEntry, FlowEntry> inactiveFlows;
private IContainer container;
- private Set<IForwardingRulesManagerAware> frmAware;
+ private Set<IForwardingRulesManagerAware> frmAware =
+ Collections.synchronizedSet(new HashSet<IForwardingRulesManagerAware>());
private PortGroupProvider portGroupProvider;
private IFlowProgrammerService programmer;
private IClusterContainerServices clusterContainerService = null;
*
*/
void init() {
- frmAware = Collections.synchronizedSet(new HashSet<IForwardingRulesManagerAware>());
frmFileName = GlobalConstants.STARTUPHOME.toString() + "frm_staticflows_" + this.getContainerName() + ".conf";
portGroupFileName = GlobalConstants.STARTUPHOME.toString() + "portgroup_" + this.getContainerName() + ".conf";
*
*/
void destroy() {
+ frmAware.clear();
}
/**
private ConcurrentMap<Long, Boolean> switchSupportsVendorExtStats;
// Per port sampled (every portStatsPeriod) transmit rate
private Map<Long, Map<Short, TxRates>> txRates;
- private Set<IOFStatisticsListener> statisticsListeners;
+ private Set<IOFStatisticsListener> statisticsListeners = new CopyOnWriteArraySet<IOFStatisticsListener>();
/**
* The object containing the latest factoredSamples tx rate samples for a
switchPortStatsUpdated = new LinkedBlockingQueue<Long>(INITIAL_SIZE);
switchSupportsVendorExtStats = new ConcurrentHashMap<Long, Boolean>(INITIAL_SIZE);
txRates = new HashMap<Long, Map<Short, TxRates>>(INITIAL_SIZE);
- statisticsListeners = new CopyOnWriteArraySet<IOFStatisticsListener>();
configStatsPollIntervals();
*
*/
void destroy() {
+ statisticsListeners.clear();
}
/**
private static final Logger logger = LoggerFactory
.getLogger(ReadService.class);
private IReadServiceFilter filter;
- private Set<IPluginOutReadService> pluginOutReadServices;
+ private Set<IPluginOutReadService> pluginOutReadServices = new CopyOnWriteArraySet<IPluginOutReadService>();
private String containerName;
private IPluginOutConnectionService connectionOutService;
@SuppressWarnings("unchecked")
void init(Component c) {
Dictionary<Object, Object> props = c.getServiceProperties();
- containerName = (props != null) ? (String) props.get("containerName")
- : null;
- pluginOutReadServices = new CopyOnWriteArraySet<IPluginOutReadService>();
+ containerName = (props != null) ? (String) props.get("containerName") : null;
}
/**
*
*/
void destroy() {
+ pluginOutReadServices.clear();
}
/**
private ConcurrentMap<String, Set<Node>> containerToNode;
private ConcurrentMap<String, Set<NodeTable>> containerToNt;
private ConcurrentMap<String, Set<ContainerFlow>> containerFlows;
- private ConcurrentMap<String, IReadFilterInternalListener> readFilterInternalListeners;
+ private ConcurrentMap<String, IReadFilterInternalListener> readFilterInternalListeners =
+ new ConcurrentHashMap<String, IReadFilterInternalListener>();
public void setController(IController core) {
this.controller = core;
containerToNt = new ConcurrentHashMap<String, Set<NodeTable>>();
containerToNode = new ConcurrentHashMap<String, Set<Node>>();
containerFlows = new ConcurrentHashMap<String, Set<ContainerFlow>>();
- readFilterInternalListeners = new ConcurrentHashMap<String, IReadFilterInternalListener>();
}
/**
*
*/
void destroy() {
+ readFilterInternalListeners.clear();
}
/**
public class ReadService implements IReadService, CommandProvider, IPluginOutReadService {
protected static final Logger logger = LoggerFactory.getLogger(ReadService.class);
- private ConcurrentHashMap<String, IPluginInReadService> pluginReader;
- private Set<IReadServiceListener> readerListeners;
+ private ConcurrentHashMap<String, IPluginInReadService> pluginReader =
+ new ConcurrentHashMap<String, IPluginInReadService>();
+ private Set<IReadServiceListener> readerListeners =
+ new CopyOnWriteArraySet<IReadServiceListener>();
/**
* Function called by the dependency manager when all the required
*
*/
void init() {
- pluginReader = new ConcurrentHashMap<String, IPluginInReadService>();
- readerListeners = new CopyOnWriteArraySet<IReadServiceListener>();
}
/**
// In case of plugin disactivating make sure we clear the
// dependencies
this.pluginReader.clear();
+ this.readerListeners.clear();
}
/**