Changing submit to execute in different providers for exception throwing
Change-Id: I2d93b365640e3be48de913e1a069d5f5a53eb303
diff --git a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
index d53d470..d608d4a 100644
--- a/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
+++ b/providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java
@@ -785,7 +785,7 @@
@Override
public void event(NetworkConfigEvent event) {
- SharedExecutors.getSingleThreadExecutor().execute(() -> {
+ SharedExecutors.getPoolThreadExecutor().execute(() -> {
if (event.configClass() == LinkDiscoveryFromDevice.class &&
CONFIG_CHANGED.contains(event.type())) {
diff --git a/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java b/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
index 4be8f5c..c13d26e 100644
--- a/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
+++ b/providers/netconf/device/src/main/java/org/onosproject/provider/netconf/device/impl/NetconfDeviceProvider.java
@@ -92,7 +92,7 @@
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 @@
@Override
public void event(NetworkConfigEvent event) {
- executor.submit(NetconfDeviceProvider.this::connectDevices);
+ executor.execute(NetconfDeviceProvider.this::connectDevices);
}
@Override
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/TopologyMutationDriver.java b/providers/null/src/main/java/org/onosproject/provider/nil/TopologyMutationDriver.java
index 032692d..5abace6 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/TopologyMutationDriver.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/TopologyMutationDriver.java
@@ -70,7 +70,7 @@
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 @@
activeLinks = reduceLinks();
inactiveLinks = Lists.newArrayList();
adjustRate(mutationRate);
- executor.submit(this);
+ executor.execute(this);
}
/**
diff --git a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
index 55e2fb8..dea928c 100644
--- a/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
+++ b/providers/rest/device/src/main/java/org/onosproject/provider/rest/device/impl/RestDeviceProvider.java
@@ -106,7 +106,7 @@
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 @@
@Override
public void event(NetworkConfigEvent event) {
- executor.submit(RestDeviceProvider.this::connectDevices);
+ executor.execute(RestDeviceProvider.this::connectDevices);
}
@Override
diff --git a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java b/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
index 51e5fd1..316b3ba 100644
--- a/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
+++ b/providers/snmp/device/src/main/java/org/onosproject/provider/snmp/device/impl/SnmpDeviceProvider.java
@@ -92,7 +92,7 @@
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 @@
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 @@
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));
}
}
}