[Falcon][ONOS-3537] Implement control message collecting logic w/ unit test
Change-Id: Ic21d476a5ad92d7ef739fa3c13dcc06e5cbf7c56
diff --git a/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java b/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java
index b410158..f9a6059 100644
--- a/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java
+++ b/protocols/openflow/ctl/src/main/java/org/onosproject/openflow/controller/impl/OpenFlowControllerImpl.java
@@ -272,10 +272,13 @@
for (PacketListener p : ofPacketListener.values()) {
p.handlePacket(pktCtx);
}
+ executorMsgs.submit(new OFMessageHandler(dpid, msg));
break;
// TODO: Consider using separate threadpool for sensitive messages.
// ie. Back to back error could cause us to starve.
case FLOW_REMOVED:
+ executorMsgs.submit(new OFMessageHandler(dpid, msg));
+ break;
case ERROR:
executorMsgs.submit(new OFMessageHandler(dpid, msg));
break;
@@ -625,6 +628,9 @@
}
}
+ /**
+ * OpenFlow message handler for incoming control messages.
+ */
protected final class OFMessageHandler implements Runnable {
protected final OFMessage msg;
@@ -641,7 +647,5 @@
listener.handleMessage(dpid, msg);
}
}
-
}
-
}