[Minor] Code cleanup
This commit is contained in:
parent
61b3a3e5bf
commit
597441653a
|
@ -37,7 +37,7 @@ public class StartupListener implements ServletContextListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contextInitialized(ServletContextEvent sce) {
|
public void contextInitialized(ServletContextEvent sce) {
|
||||||
|
try {
|
||||||
String realPath = sce.getServletContext().getRealPath("/WEB-INF");
|
String realPath = sce.getServletContext().getRealPath("/WEB-INF");
|
||||||
|
|
||||||
File pathF = new File(realPath);
|
File pathF = new File(realPath);
|
||||||
|
@ -47,6 +47,10 @@ public class StartupListener implements ServletContextListener {
|
||||||
this.agent.initialize();
|
this.agent.initialize();
|
||||||
this.agent.start();
|
this.agent.start();
|
||||||
logger.info("Agent started.");
|
logger.info("Agent started.");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Server startup failed due to: " + e.getMessage(), e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class StartupListener implements ServletContextListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contextInitialized(ServletContextEvent sce) {
|
public void contextInitialized(ServletContextEvent sce) {
|
||||||
|
try {
|
||||||
String realPath = sce.getServletContext().getRealPath("/WEB-INF");
|
String realPath = sce.getServletContext().getRealPath("/WEB-INF");
|
||||||
|
|
||||||
File pathF = new File(realPath);
|
File pathF = new File(realPath);
|
||||||
|
@ -47,6 +47,10 @@ public class StartupListener implements ServletContextListener {
|
||||||
this.agent.initialize();
|
this.agent.initialize();
|
||||||
this.agent.start();
|
this.agent.start();
|
||||||
logger.info("Agent started.");
|
logger.info("Agent started.");
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Server startup failed due to: " + e.getMessage(), e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,22 +22,22 @@ public class StartupListener implements ServletContextListener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void contextInitialized(ServletContextEvent sce) {
|
public void contextInitialized(ServletContextEvent sce) {
|
||||||
|
try {
|
||||||
String realPath = sce.getServletContext().getRealPath("/WEB-INF");
|
String realPath = sce.getServletContext().getRealPath("/WEB-INF");
|
||||||
|
|
||||||
File pathF = new File(realPath);
|
File pathF = new File(realPath);
|
||||||
String environment = StrolchEnvironment.getEnvironmentFromEnvProperties(pathF);
|
String environment = StrolchEnvironment.getEnvironmentFromEnvProperties(pathF);
|
||||||
logger.info("Starting Strolch Minimal Rest...");
|
logger.info("Starting Strolch Minimal Rest...");
|
||||||
try {
|
|
||||||
this.agent = new StrolchBootstrapper(StartupListener.class).setupByRoot(environment, pathF);
|
this.agent = new StrolchBootstrapper(StartupListener.class).setupByRoot(environment, pathF);
|
||||||
this.agent.initialize();
|
this.agent.initialize();
|
||||||
this.agent.start();
|
this.agent.start();
|
||||||
} catch (Exception e) {
|
|
||||||
logger.error("Failed to start Strolch due to: " + e.getMessage(), e);
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
|
|
||||||
logger.info("Started Strolch Minimal Rest.");
|
logger.info("Started Strolch Minimal Rest.");
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Server startup failed due to: " + e.getMessage(), e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue