[ONOS-4930] Fix NPE from ScalableGateway caused by the event triggered before map creation
Change-Id: I4b4890274bafbac8eae9059a9ceaf390ab290a9b
Showing
1 changed file
with
6 additions
and
5 deletions
| ... | @@ -122,11 +122,6 @@ public class ScalableGatewayManager implements ScalableGatewayService { | ... | @@ -122,11 +122,6 @@ public class ScalableGatewayManager implements ScalableGatewayService { |
| 122 | @Activate | 122 | @Activate |
| 123 | protected void activate() { | 123 | protected void activate() { |
| 124 | appId = coreService.registerApplication(APP_ID); | 124 | appId = coreService.registerApplication(APP_ID); |
| 125 | - configRegistry.registerConfigFactory(configFactory); | ||
| 126 | - configService.addListener(configListener); | ||
| 127 | - deviceService.addListener(internalDeviceListener); | ||
| 128 | - | ||
| 129 | - selectGroupHandler = new SelectGroupHandler(groupService, deviceService, driverService, appId); | ||
| 130 | 125 | ||
| 131 | gatewayNodeMap = storageService.<DeviceId, GatewayNode>consistentMapBuilder() | 126 | gatewayNodeMap = storageService.<DeviceId, GatewayNode>consistentMapBuilder() |
| 132 | .withSerializer(Serializer.using(GATEWAYNODE_SERIALIZER.build())) | 127 | .withSerializer(Serializer.using(GATEWAYNODE_SERIALIZER.build())) |
| ... | @@ -134,6 +129,12 @@ public class ScalableGatewayManager implements ScalableGatewayService { | ... | @@ -134,6 +129,12 @@ public class ScalableGatewayManager implements ScalableGatewayService { |
| 134 | .withApplicationId(appId) | 129 | .withApplicationId(appId) |
| 135 | .build(); | 130 | .build(); |
| 136 | 131 | ||
| 132 | + configRegistry.registerConfigFactory(configFactory); | ||
| 133 | + configService.addListener(configListener); | ||
| 134 | + deviceService.addListener(internalDeviceListener); | ||
| 135 | + | ||
| 136 | + selectGroupHandler = new SelectGroupHandler(groupService, deviceService, driverService, appId); | ||
| 137 | + | ||
| 137 | log.info("started"); | 138 | log.info("started"); |
| 138 | } | 139 | } |
| 139 | 140 | ... | ... |
-
Please register or login to post a comment