Committed by
Gerrit Code Review
Load ComponentConfigService in IntentManager
Change-Id: I8b292edc9afdc7a8c3aaab511ed338b8497eb6de
Showing
2 changed files
with
11 additions
and
0 deletions
| ... | @@ -24,6 +24,7 @@ import org.apache.felix.scr.annotations.Reference; | ... | @@ -24,6 +24,7 @@ import org.apache.felix.scr.annotations.Reference; |
| 24 | import org.apache.felix.scr.annotations.ReferenceCardinality; | 24 | import org.apache.felix.scr.annotations.ReferenceCardinality; |
| 25 | import org.apache.felix.scr.annotations.Service; | 25 | import org.apache.felix.scr.annotations.Service; |
| 26 | import org.onlab.util.Tools; | 26 | import org.onlab.util.Tools; |
| 27 | +import org.onosproject.cfg.ComponentConfigService; | ||
| 27 | import org.onosproject.core.CoreService; | 28 | import org.onosproject.core.CoreService; |
| 28 | import org.onosproject.core.IdGenerator; | 29 | import org.onosproject.core.IdGenerator; |
| 29 | import org.onosproject.event.AbstractListenerManager; | 30 | import org.onosproject.event.AbstractListenerManager; |
| ... | @@ -115,6 +116,10 @@ public class IntentManager | ... | @@ -115,6 +116,10 @@ public class IntentManager |
| 115 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | 116 | @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) |
| 116 | protected ResourceService resourceService; | 117 | protected ResourceService resourceService; |
| 117 | 118 | ||
| 119 | + @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY) | ||
| 120 | + protected ComponentConfigService configService; | ||
| 121 | + | ||
| 122 | + | ||
| 118 | private ExecutorService batchExecutor; | 123 | private ExecutorService batchExecutor; |
| 119 | private ExecutorService workerExecutor; | 124 | private ExecutorService workerExecutor; |
| 120 | 125 | ||
| ... | @@ -131,6 +136,8 @@ public class IntentManager | ... | @@ -131,6 +136,8 @@ public class IntentManager |
| 131 | 136 | ||
| 132 | @Activate | 137 | @Activate |
| 133 | public void activate() { | 138 | public void activate() { |
| 139 | + configService.registerProperties(getClass()); | ||
| 140 | + | ||
| 134 | intentInstaller.init(store, trackerService, flowRuleService, flowObjectiveService); | 141 | intentInstaller.init(store, trackerService, flowRuleService, flowObjectiveService); |
| 135 | if (skipReleaseResourcesOnWithdrawal) { | 142 | if (skipReleaseResourcesOnWithdrawal) { |
| 136 | store.setDelegate(testOnlyDelegate); | 143 | store.setDelegate(testOnlyDelegate); |
| ... | @@ -154,6 +161,7 @@ public class IntentManager | ... | @@ -154,6 +161,7 @@ public class IntentManager |
| 154 | } else { | 161 | } else { |
| 155 | store.unsetDelegate(delegate); | 162 | store.unsetDelegate(delegate); |
| 156 | } | 163 | } |
| 164 | + configService.unregisterProperties(getClass(), false); | ||
| 157 | trackerService.unsetDelegate(topoDelegate); | 165 | trackerService.unsetDelegate(topoDelegate); |
| 158 | eventDispatcher.removeSink(IntentEvent.class); | 166 | eventDispatcher.removeSink(IntentEvent.class); |
| 159 | batchExecutor.shutdown(); | 167 | batchExecutor.shutdown(); | ... | ... |
| ... | @@ -28,6 +28,7 @@ import org.junit.Ignore; | ... | @@ -28,6 +28,7 @@ import org.junit.Ignore; |
| 28 | import org.junit.Test; | 28 | import org.junit.Test; |
| 29 | import org.onosproject.TestApplicationId; | 29 | import org.onosproject.TestApplicationId; |
| 30 | import org.onosproject.cfg.ComponentConfigAdapter; | 30 | import org.onosproject.cfg.ComponentConfigAdapter; |
| 31 | +import org.onosproject.cfg.ComponentConfigService; | ||
| 31 | import org.onosproject.common.event.impl.TestEventDispatcher; | 32 | import org.onosproject.common.event.impl.TestEventDispatcher; |
| 32 | import org.onosproject.core.ApplicationId; | 33 | import org.onosproject.core.ApplicationId; |
| 33 | import org.onosproject.core.impl.TestCoreManager; | 34 | import org.onosproject.core.impl.TestCoreManager; |
| ... | @@ -57,6 +58,7 @@ import java.util.concurrent.TimeUnit; | ... | @@ -57,6 +58,7 @@ import java.util.concurrent.TimeUnit; |
| 57 | import java.util.stream.Collectors; | 58 | import java.util.stream.Collectors; |
| 58 | import java.util.stream.IntStream; | 59 | import java.util.stream.IntStream; |
| 59 | 60 | ||
| 61 | +import static org.easymock.EasyMock.mock; | ||
| 60 | import static org.hamcrest.MatcherAssert.assertThat; | 62 | import static org.hamcrest.MatcherAssert.assertThat; |
| 61 | import static org.hamcrest.Matchers.hasSize; | 63 | import static org.hamcrest.Matchers.hasSize; |
| 62 | import static org.hamcrest.Matchers.is; | 64 | import static org.hamcrest.Matchers.is; |
| ... | @@ -231,6 +233,7 @@ public class IntentManagerTest { | ... | @@ -231,6 +233,7 @@ public class IntentManagerTest { |
| 231 | manager.trackerService = new TestIntentTracker(); | 233 | manager.trackerService = new TestIntentTracker(); |
| 232 | manager.flowRuleService = flowRuleService; | 234 | manager.flowRuleService = flowRuleService; |
| 233 | manager.coreService = new TestCoreManager(); | 235 | manager.coreService = new TestCoreManager(); |
| 236 | + manager.configService = mock(ComponentConfigService.class); | ||
| 234 | service = manager; | 237 | service = manager; |
| 235 | extensionService = manager; | 238 | extensionService = manager; |
| 236 | 239 | ... | ... |
-
Please register or login to post a comment