Daniel Park

[ONOS-4930] Fix NPE from ScalableGateway caused by the event triggered before map creation

Change-Id: I4b4890274bafbac8eae9059a9ceaf390ab290a9b
......@@ -122,11 +122,6 @@ public class ScalableGatewayManager implements ScalableGatewayService {
@Activate
protected void activate() {
appId = coreService.registerApplication(APP_ID);
configRegistry.registerConfigFactory(configFactory);
configService.addListener(configListener);
deviceService.addListener(internalDeviceListener);
selectGroupHandler = new SelectGroupHandler(groupService, deviceService, driverService, appId);
gatewayNodeMap = storageService.<DeviceId, GatewayNode>consistentMapBuilder()
.withSerializer(Serializer.using(GATEWAYNODE_SERIALIZER.build()))
......@@ -134,6 +129,12 @@ public class ScalableGatewayManager implements ScalableGatewayService {
.withApplicationId(appId)
.build();
configRegistry.registerConfigFactory(configFactory);
configService.addListener(configListener);
deviceService.addListener(internalDeviceListener);
selectGroupHandler = new SelectGroupHandler(groupService, deviceService, driverService, appId);
log.info("started");
}
......