private static synchronized void restartApp() { if (!MscOpts.hasRapidoidWatch()) { Log.warn("Cannot reload/restart the application, module rapidoid-watch is missing!"); } if (mainClassName == null) { Log.warn("Cannot reload/restart the application, the main app class couldn't be detected!"); } Msc.logSection("!Restarting the web application..."); restarted = true; notifyListenersBeforeRestart(); resetAppStateBeforeRestart(); if (MscOpts.hasRapidoidJPA()) { loader = ReloadUtil.reloader(); ClasspathUtil.setDefaultClassLoader(loader); } reloadAndRunMainClass(); restarted = true; notifyListenersAfterRestart(); Log.info("!Successfully restarted the application!"); }
private synchronized void listen() { if (!listening && !reloaded) { App.inferCallers(); listening = true; HttpProcessor proc = processor != null ? processor : http(); if (Env.dev() && !On.changes().isIgnored() && MscOpts.hasRapidoidWatch()) { proc = new AppRestartProcessor(this, proc); On.changes().byDefaultRestart(); } if (server == null) { int targetPort = port(); server = proc.listen(address(), targetPort); Log.info("!Server has started", "setup", name(), "!home", "http://localhost:" + targetPort); Log.info("!Static resources will be served from the following locations", "setup", name(), "!locations", custom().staticFilesPath()); } } }
private static synchronized void restartApp() { if (!MscOpts.hasRapidoidWatch()) { Log.warn("Cannot reload/restart the application, module rapidoid-watch is missing!"); } if (mainClassName == null) { Log.warn("Cannot reload/restart the application, the main app class couldn't be detected!"); } Msc.logSection("!Restarting the web application..."); restarted = true; notifyListenersBeforeRestart(); resetAppStateBeforeRestart(); if (MscOpts.hasRapidoidJPA()) { loader = ReloadUtil.reloader(); ClasspathUtil.setDefaultClassLoader(loader); } reloadAndRunMainClass(); restarted = true; notifyListenersAfterRestart(); Log.info("!Successfully restarted the application!"); }
private synchronized void listen() { if (!listening && !reloaded) { App.inferCallers(); listening = true; HttpProcessor proc = processor != null ? processor : http(); if (Env.dev() && !On.changes().isIgnored() && MscOpts.hasRapidoidWatch()) { proc = new AppRestartProcessor(this, proc); On.changes().byDefaultRestart(); } if (delegateAdminToApp()) { server = on().server(); } else if (delegateAppToAdmin()) { server = admin().server(); } if (server == null) { int targetPort; if (isAppOrAdminOnSameServer()) { targetPort = on().port(); server = proc.listen(on().address(), targetPort); } else { targetPort = port(); server = proc.listen(address(), targetPort); } Log.info("!Server has started", "setup", name(), "!home", "http://localhost:" + targetPort); Log.info("!Static resources will be served from the following locations", "setup", name(), "!locations", custom().staticFilesPath()); } } }