diff --git a/src/main/java/net/floodlightcontroller/core/internal/Controller.java b/src/main/java/net/floodlightcontroller/core/internal/Controller.java index f11bbf6fd59029c912a462013609f3486fd0f790..c087bf217c052cbdafcbce314947c2683c7a2685 100644 --- a/src/main/java/net/floodlightcontroller/core/internal/Controller.java +++ b/src/main/java/net/floodlightcontroller/core/internal/Controller.java @@ -1690,7 +1690,7 @@ public class Controller implements IFloodlightProviderService { if (threads != null) { this.workerThreads = Integer.parseInt(threads); } - log.info("Number of worker threads port set to {}", this.workerThreads); + log.info("Number of worker threads set to {}", this.workerThreads); String controllerId = configParams.get("controllerid"); if (controllerId != null) { this.controllerId = controllerId; diff --git a/src/main/java/net/floodlightcontroller/jython/JythonDebugInterface.java b/src/main/java/net/floodlightcontroller/jython/JythonDebugInterface.java index 0eb532963b8abe31b9d4c4dbba726f2070d3cc3e..19a97b5b93992b302e1557a758bd1f0324a3c6ca 100644 --- a/src/main/java/net/floodlightcontroller/jython/JythonDebugInterface.java +++ b/src/main/java/net/floodlightcontroller/jython/JythonDebugInterface.java @@ -14,7 +14,8 @@ import net.floodlightcontroller.core.module.IFloodlightService; public class JythonDebugInterface implements IFloodlightModule { protected static Logger log = LoggerFactory.getLogger(JythonDebugInterface.class); - JythonServer debug_server; + protected JythonServer debug_server; + protected static int JYTHON_PORT = 6655; @Override public Collection<Class<? extends IFloodlightService>> getModuleServices() { @@ -44,8 +45,7 @@ public class JythonDebugInterface implements IFloodlightModule { @Override public void startUp(FloodlightModuleContext context) { - Map<String, Object> locals = new HashMap<String, Object>(); - + Map<String, Object> locals = new HashMap<String, Object>(); // add all existing module references to the debug server for (Class<? extends IFloodlightService> s : context.getAllServices()) { // Put only the last part of the name @@ -54,7 +54,15 @@ public class JythonDebugInterface implements IFloodlightModule { locals.put(name, context.getServiceImpl(s)); } - JythonServer debug_server = new JythonServer(6655, locals); + // read our config options + Map<String, String> configOptions = context.getConfigParams(this); + int port = JYTHON_PORT; + String portNum = configOptions.get("port"); + if (portNum != null) { + port = Integer.parseInt(portNum); + } + + JythonServer debug_server = new JythonServer(port, locals); debug_server.start(); } } diff --git a/src/main/resources/floodlightdefault.properties b/src/main/resources/floodlightdefault.properties index 687660194cf2dde6816c2fb94e3cf0388b2a4588..27b2795b3ed7443d3a32689dc2213708d0172505 100644 --- a/src/main/resources/floodlightdefault.properties +++ b/src/main/resources/floodlightdefault.properties @@ -7,3 +7,4 @@ net.floodlightcontroller.perfmon.PktInProcessingTime,\ net.floodlightcontroller.ui.web.StaticWebRoutable net.floodlightcontroller.restserver.RestApiServer.port = 8080 net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633 +net.floodlightcontroller.jython.JythonDebugInterface.port = 6655 \ No newline at end of file