Andrea Campanella
Committed by Gerrit Code Review

Changing submit to execute in different providers for exception throwing

Change-Id: I2d93b365640e3be48de913e1a069d5f5a53eb303
......@@ -785,7 +785,7 @@ public class LldpLinkProvider extends AbstractProvider implements LinkProvider {
@Override
public void event(NetworkConfigEvent event) {
SharedExecutors.getSingleThreadExecutor().execute(() -> {
SharedExecutors.getPoolThreadExecutor().execute(() -> {
if (event.configClass() == LinkDiscoveryFromDevice.class &&
CONFIG_CHANGED.contains(event.type())) {
......
......@@ -92,7 +92,7 @@ public class NetconfDeviceProvider extends AbstractProvider
private static final String UNKNOWN = "unknown";
private final ExecutorService executor =
Executors.newFixedThreadPool(5, groupedThreads("onos/netconfdeviceprovider", "device-installer-%d"));
Executors.newFixedThreadPool(5, groupedThreads("onos/netconfdeviceprovider", "device-installer-%d", log));
private DeviceProviderService providerService;
private NetconfDeviceListener innerNodeListener = new InnerNetconfDeviceListener();
......@@ -235,7 +235,7 @@ public class NetconfDeviceProvider extends AbstractProvider
@Override
public void event(NetworkConfigEvent event) {
executor.submit(NetconfDeviceProvider.this::connectDevices);
executor.execute(NetconfDeviceProvider.this::connectDevices);
}
@Override
......
......@@ -70,7 +70,7 @@ class TopologyMutationDriver implements Runnable {
private List<LinkDescription> inactiveLinks;
private final ExecutorService executor =
newSingleThreadScheduledExecutor(groupedThreads("onos/null", "topo-mutator"));
newSingleThreadScheduledExecutor(groupedThreads("onos/null", "topo-mutator", log));
private Map<DeviceId, Set<Link>> savedLinks = Maps.newConcurrentMap();
......@@ -99,7 +99,7 @@ class TopologyMutationDriver implements Runnable {
activeLinks = reduceLinks();
inactiveLinks = Lists.newArrayList();
adjustRate(mutationRate);
executor.submit(this);
executor.execute(this);
}
/**
......
......@@ -106,7 +106,7 @@ public class RestDeviceProvider extends AbstractProvider
private static final String UNKNOWN = "unknown";
private final ExecutorService executor =
Executors.newFixedThreadPool(5, groupedThreads("onos/restsbprovider", "device-installer-%d"));
Executors.newFixedThreadPool(5, groupedThreads("onos/restsbprovider", "device-installer-%d", log));
private final ConfigFactory factory =
new ConfigFactory<ApplicationId, RestProviderConfig>(APP_SUBJECT_FACTORY,
......@@ -279,7 +279,7 @@ public class RestDeviceProvider extends AbstractProvider
@Override
public void event(NetworkConfigEvent event) {
executor.submit(RestDeviceProvider.this::connectDevices);
executor.execute(RestDeviceProvider.this::connectDevices);
}
@Override
......
......@@ -92,7 +92,7 @@ public class SnmpDeviceProvider extends AbstractProvider
protected ComponentConfigService cfgService;
private final ExecutorService deviceBuilder = Executors
.newFixedThreadPool(1, groupedThreads("onos/snmp", "device-creator"));
.newFixedThreadPool(1, groupedThreads("onos/snmp", "device-creator", log));
// Delay between events in ms.
private static final int EVENTINTERVAL = 5;
......@@ -140,7 +140,7 @@ public class SnmpDeviceProvider extends AbstractProvider
try {
snmpDeviceMap
.entrySet().stream().forEach((deviceEntry) -> {
deviceBuilder.submit(new DeviceCreator(deviceEntry.getValue(), false));
deviceBuilder.execute(new DeviceCreator(deviceEntry.getValue(), false));
});
deviceBuilder.awaitTermination(1000, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
......@@ -184,9 +184,9 @@ public class SnmpDeviceProvider extends AbstractProvider
device.getDeviceState().name()}
);
if (device.isActive()) {
deviceBuilder.submit(new DeviceCreator(device, true));
deviceBuilder.execute(new DeviceCreator(device, true));
} else {
deviceBuilder.submit(new DeviceCreator(device, false));
deviceBuilder.execute(new DeviceCreator(device, false));
}
}
}
......