Reshuffled init order to allow web server port modification
This commit is contained in:
parent
b710626ad0
commit
070aeb35d7
2 changed files with 13 additions and 12 deletions
|
|
@ -54,7 +54,7 @@ public class HalContext {
|
||||||
private static UserMessageManager messageManager = new UserMessageManager();
|
private static UserMessageManager messageManager = new UserMessageManager();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
// Set default values to get Hal up and running
|
// Set default values to get Hal up and running before DB is read in
|
||||||
fileConf.setProperty(CONFIG_HTTP_PORT, "" + 8080);
|
fileConf.setProperty(CONFIG_HTTP_PORT, "" + 8080);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,27 +47,28 @@ public class HalServer {
|
||||||
// Initialize Hal
|
// Initialize Hal
|
||||||
// ------------------------------------
|
// ------------------------------------
|
||||||
|
|
||||||
// init logging
|
// Init basic dependencies
|
||||||
|
|
||||||
LogUtil.readConfiguration("logging.properties");
|
LogUtil.readConfiguration("logging.properties");
|
||||||
|
HalContext.initialize();
|
||||||
|
DBConnection db = HalContext.getDB();
|
||||||
|
|
||||||
|
pluginManager = new PluginManager();
|
||||||
|
daemonExecutor = Executors.newScheduledThreadPool(1); // We set only one thread for easier troubleshooting for now
|
||||||
|
|
||||||
|
// Init core web server
|
||||||
|
|
||||||
http = new HttpServer(HalContext.getIntegerProperty(HalContext.CONFIG_HTTP_PORT));
|
http = new HttpServer(HalContext.getIntegerProperty(HalContext.CONFIG_HTTP_PORT));
|
||||||
http.setDefaultPage(new StartupWebPage());
|
http.setDefaultPage(new StartupWebPage());
|
||||||
http.start();
|
http.start();
|
||||||
|
|
||||||
// init variables
|
|
||||||
pluginManager = new PluginManager();
|
|
||||||
daemonExecutor = Executors.newScheduledThreadPool(1); // We set only one thread for easier troubleshooting for now
|
|
||||||
|
|
||||||
// Upgrade database
|
// Upgrade database
|
||||||
|
|
||||||
|
logger.info("Working directory: " + FileUtil.find(".").getAbsolutePath());
|
||||||
HalDatabaseUpgradeManager.initialize(pluginManager);
|
HalDatabaseUpgradeManager.initialize(pluginManager);
|
||||||
HalDatabaseUpgradeManager.upgrade();
|
HalDatabaseUpgradeManager.upgrade();
|
||||||
|
|
||||||
// init DB and other configurations
|
// Init external web server
|
||||||
|
|
||||||
HalContext.initialize();
|
|
||||||
DBConnection db = HalContext.getDB();
|
|
||||||
|
|
||||||
logger.info("Working directory: " + FileUtil.find(".").getAbsolutePath());
|
|
||||||
|
|
||||||
httpExternal = new HalExternalWebDaemon();
|
httpExternal = new HalExternalWebDaemon();
|
||||||
registerDaemon(httpExternal);
|
registerDaemon(httpExternal);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue