diff options
author | Ashlee Young <ashlee@wildernessvoice.com> | 2015-12-06 07:15:03 -0800 |
---|---|---|
committer | Ashlee Young <ashlee@wildernessvoice.com> | 2015-12-08 10:55:21 -0800 |
commit | 76dc892491948adae5e5e62cf94448967e8d865b (patch) | |
tree | 7a33ef05cc583946db21edad627060f280a53549 /framework/src/onos/protocols/openflow/ctl/src/main | |
parent | d333c63fdec8b064184b0a26f8d777f267577fde (diff) |
Fixes bad POM file with ONOS commit 8c68536972f63069c263635c9d9f4f31d7f3e9a2
Change-Id: I7adb5a2d3738d53dbc41db7577768b0e7ced5450
Signed-off-by: Ashlee Young <ashlee@wildernessvoice.com>
Diffstat (limited to 'framework/src/onos/protocols/openflow/ctl/src/main')
-rw-r--r-- | framework/src/onos/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/framework/src/onos/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java b/framework/src/onos/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java index b97c3362..b410158e 100644 --- a/framework/src/onos/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java +++ b/framework/src/onos/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java @@ -27,6 +27,7 @@ import org.apache.felix.scr.annotations.Reference; import org.apache.felix.scr.annotations.ReferenceCardinality; import org.apache.felix.scr.annotations.Service; import org.onosproject.cfg.ComponentConfigService; +import org.onosproject.core.CoreService; import org.onosproject.net.driver.DefaultDriverProviderService; import org.onosproject.net.driver.DriverService; import org.onosproject.openflow.controller.DefaultOpenFlowPacketContext; @@ -83,6 +84,7 @@ import static org.onlab.util.Tools.groupedThreads; @Component(immediate = true) @Service public class OpenFlowControllerImpl implements OpenFlowController { + private static final String APP_ID = "org.onosproject.openflow-base"; private static final String DEFAULT_OFPORT = "6633,6653"; private static final int DEFAULT_WORKER_THREADS = 16; @@ -90,6 +92,9 @@ public class OpenFlowControllerImpl implements OpenFlowController { LoggerFactory.getLogger(OpenFlowControllerImpl.class); @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) + protected CoreService coreService; + + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) protected DriverService driverService; // References exists merely for sequencing purpose to assure drivers are loaded @@ -147,15 +152,24 @@ public class OpenFlowControllerImpl implements OpenFlowController { @Activate public void activate(ComponentContext context) { + coreService.registerApplication(APP_ID, this::preDeactivate); cfgService.registerProperties(getClass()); ctrl.setConfigParams(context.getProperties()); ctrl.start(agent, driverService); } + private void preDeactivate() { + // Close listening channel and all OF channels before deactivating + ctrl.stop(); + connectedSwitches.values().forEach(OpenFlowSwitch::disconnectSwitch); + } + @Deactivate public void deactivate() { cfgService.unregisterProperties(getClass(), false); - ctrl.stop(); + connectedSwitches.clear(); + activeMasterSwitches.clear(); + activeEqualSwitches.clear(); } @Modified |