}
}
+ /**
+ * Function called by the dependency manager before Container is Stopped and Destroyed.
+ */
+ public void containerStop() {
+ uninstallAllFlowEntries(false);
+ }
+
/**
* Function called by the dependency manager before the services exported by
* the component are unregistered, this will be followed by a "destroy ()"
*/
void stop() {
stopping = true;
- uninstallAllFlowEntries(false);
// Shutdown executor
this.executor.shutdownNow();
// Now walk all the workMonitor and wake up the one sleeping because
Logger logger = LoggerFactory
.getLogger(ComponentActivatorAbstractBase.class);
private DependencyManager dm;
- private ConcurrentMap<ImmutablePair<String, Object>, Component> dbInstances = (ConcurrentMap<ImmutablePair<String, Object>, Component>) new ConcurrentHashMap<ImmutablePair<String, Object>, Component>();
- private ConcurrentMap<Object, Component> dbGlobalInstances = (ConcurrentMap<Object, Component>) new ConcurrentHashMap<Object, Component>();
+ private ConcurrentMap<ImmutablePair<String, Object>, Component> dbInstances = new ConcurrentHashMap<ImmutablePair<String, Object>, Component>();
+ private ConcurrentMap<Object, Component> dbGlobalInstances = new ConcurrentHashMap<Object, Component>();
/**
* Method that should be overriden by the derived class for customization
containerName, imps[i]);
Component c = this.dbInstances.get(key);
if (c != null) {
+ if (c.getService() != null) {
+ c.invokeCallbackMethod(new Object[] { c.getService() }, "containerStop",
+ new Class[][] {{ Component.class}, {} },
+ new Object[][] { {c}, {} });
+ }
// Now remove the component from dependency manager,
// which will implicitely stop it first
this.dm.remove(c);
log.debug("Host Facing Port in a container came up, install the rules for all hosts from this port !");
Set<HostNodeConnector> allHosts = this.hostTracker.getAllHosts();
for (HostNodeConnector host : allHosts) {
- if (node.equals(host.getnodeconnectorNode())
- && swPort.equals(host.getnodeConnector())) {
+ if (node.equals(host.getnodeconnectorNode())) {
/*
* This host resides behind the same switch and port for which a port up
* message is received. Ideally this should not happen, but if it does,