Skip to content
Snippets Groups Projects
Commit fde48873 authored by Alex Reimers's avatar Alex Reimers
Browse files

Merge pull request #32 from lalithsuresh/patch

Fix restPort hard coding
parents 40da007e 6e66dae6
No related branches found
No related tags found
Loading
......@@ -36,7 +36,7 @@ public class Main {
FloodlightModuleLoader fml = new FloodlightModuleLoader();
IFloodlightModuleContext moduleContext = fml.loadModulesFromConfig(settings.getModuleFile());
IRestApiService restApi = moduleContext.getServiceImpl(IRestApiService.class);
restApi.run();
restApi.run(settings.getRestPort());
IFloodlightProviderService controller =
moduleContext.getServiceImpl(IFloodlightProviderService.class);
controller.setCmdLineOptions(settings);
......
......@@ -12,5 +12,5 @@ public interface IRestApiService extends IFloodlightService {
/**
* Runs the REST API server
*/
public void run();
public void run(int restPort);
}
......@@ -30,7 +30,6 @@ public class RestApiServer
implements IFloodlightModule, IRestApiService {
protected static Logger logger = LoggerFactory.getLogger(RestApiServer.class);
protected List<RestletRoutable> restlets;
protected int restPort = 8080;
protected FloodlightModuleContext fmlContext;
// ***********
......@@ -72,7 +71,7 @@ public class RestApiServer
return slashFilter;
}
public void run(FloodlightModuleContext fmlContext) {
public void run(FloodlightModuleContext fmlContext, int restPort) {
// Add everything in the module context to the rest
for (Class<? extends IFloodlightService> s : fmlContext.getAllServices()) {
context.getAttributes().put(s.getCanonicalName(),
......@@ -108,9 +107,9 @@ public class RestApiServer
}
@Override
public void run() {
public void run(int restPort) {
RestApplication restApp = new RestApplication();
restApp.run(fmlContext);
restApp.run(fmlContext, restPort);
}
// *****************
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment