log uncaught Exception
- Use execute instead of submit so that uncaught Exception will
be dealt and logged by ExecutorService's handler.
- Use component's own logger
Change-Id: I761264aea00748980929b5048e111756776dd2f6
diff --git a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
index cac3717..b6c748a 100644
--- a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
@@ -134,7 +134,7 @@
@Activate
protected void activate() {
- executorService = newFixedThreadPool(4, groupedThreads("onos/objective-installer", "%d"));
+ executorService = newFixedThreadPool(4, groupedThreads("onos/objective-installer", "%d", log));
flowObjectiveStore.setDelegate(delegate);
mastershipService.addListener(mastershipListener);
deviceService.addListener(deviceListener);
@@ -191,7 +191,7 @@
//Attempts to check if pipeliner is null for retry attempts
} else if (numAttempts < INSTALL_RETRY_ATTEMPTS) {
Thread.sleep(INSTALL_RETRY_INTERVAL);
- executorService.submit(new ObjectiveInstaller(deviceId, objective, numAttempts + 1));
+ executorService.execute(new ObjectiveInstaller(deviceId, objective, numAttempts + 1));
} else {
// Otherwise we've tried a few times and failed, report an
// error back to the user.
@@ -208,7 +208,7 @@
@Override
public void filter(DeviceId deviceId, FilteringObjective filteringObjective) {
checkPermission(FLOWRULE_WRITE);
- executorService.submit(new ObjectiveInstaller(deviceId, filteringObjective));
+ executorService.execute(new ObjectiveInstaller(deviceId, filteringObjective));
}
@Override
@@ -217,14 +217,14 @@
if (queueObjective(deviceId, forwardingObjective)) {
return;
}
- executorService.submit(new ObjectiveInstaller(deviceId, forwardingObjective));
+ executorService.execute(new ObjectiveInstaller(deviceId, forwardingObjective));
}
@Override
public void next(DeviceId deviceId, NextObjective nextObjective) {
checkPermission(FLOWRULE_WRITE);
nextToDevice.put(nextObjective.id(), deviceId);
- executorService.submit(new ObjectiveInstaller(deviceId, nextObjective));
+ executorService.execute(new ObjectiveInstaller(deviceId, nextObjective));
}
@Override