Executor initialization moved to activate() method

Change-Id: I91922b467794d25405c2c11cf2fc626efbaa4f22
This commit is contained in:
Michal Mach 2017-06-21 09:12:24 +02:00 committed by Andrea Campanella
parent 7b821709a3
commit 13072e2370

View File

@ -130,8 +130,7 @@ public class RestDeviceProvider extends AbstractProvider
private DeviceProviderService providerService;
private ApplicationId appId;
private final ExecutorService executor =
Executors.newFixedThreadPool(5, groupedThreads("onos/restsbprovider", "device-installer-%d", log));
private ExecutorService executor;
private SharedScheduledExecutorService portStatisticsExecutor = SharedScheduledExecutors.getPoolThreadExecutor();
protected final List<ConfigFactory> factories = ImmutableList.of(
@ -164,6 +163,7 @@ public class RestDeviceProvider extends AbstractProvider
appId = coreService.registerApplication(APP_NAME);
providerService = providerRegistry.register(this);
factories.forEach(cfgService::registerConfigFactory);
executor = Executors.newFixedThreadPool(5, groupedThreads("onos/restsbprovider", "device-installer-%d", log));
cfgService.addListener(cfgLister);
executor.execute(RestDeviceProvider.this::createAndConnectDevices);
executor.execute(RestDeviceProvider.this::createDevices);