Give each Thread a name for easier debugging
diff --git a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
index da5a6f4..187465f 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
@@ -82,6 +82,8 @@
protected class SwitchCleanup implements ControlChangeCallback, Runnable {
@Override
public void run() {
+ String old = Thread.currentThread().getName();
+ Thread.currentThread().setName("SwitchCleanup " + Thread.currentThread().getId());
try {
log.debug("Running cleanup thread");
switchCleanup();
@@ -92,6 +94,7 @@
op.close();
cleanupTask.reschedule(CLEANUP_TASK_INTERVAL,
TimeUnit.SECONDS);
+ Thread.currentThread().setName(old);
}
}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
index 3538eb4..87cc4ce 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowEventHandler.java
@@ -148,6 +148,7 @@
*/
@Override
public void run() {
+ this.setName("FlowEventHandler " + this.getId());
startup();
//
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
index 82680df..26bff9b 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowmanager/FlowManager.java
@@ -582,6 +582,7 @@
// The main loop
//
Collection<FlowPath> collection = new LinkedList<FlowPath>();
+ this.setName("FlowDatabaseWriter " + this.getId() );
try {
while (true) {
FlowPath flowPath = blockingQueue.take();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
index 6485c5e..4529382 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowPusher.java
@@ -152,6 +152,7 @@
@Override
public void run() {
+ this.setName("FlowPusherThread " + this.getId() );
while (true) {
try {
// wait for message pushed to queue