@Override
public final void onApplicationEvent(final ApplicationContextEvent event) {
try {
final ApplicationContext context = event.getApplicationContext();
if (context instanceof XmlWebApplicationContext) {
final XmlWebApplicationContext ctx = (XmlWebApplicationContext) context;
String webContextName = ctx.getServletContext().getServletContextName();
if (webContextName.contains("/")) {
webContextName = webContextName.substring(webContextName.indexOf('/'));
}
ctx.setDisplayName(webContextName);
MDC.put(LeveringVeld.MDC_APPLICATIE_NAAM, webContextName).close();
}
LOGGER.debug("Context event '{}'; id='{}', displayName='{}'", event.getClass().getSimpleName(), event
.getApplicationContext().getId(), event.getApplicationContext().getDisplayName());
if (event instanceof ContextClosedEvent) {
LOGGER.info("==> Context voor applicatie '{}' is gestopt", event.getApplicationContext().getId());
}
/* Wanneer een applicatie is gestart, dan wordt een ContextRefreshedEvent gestuurt **/
if (event instanceof ContextRefreshedEvent) {
LOGGER.info("==> Context voor applicatie '{}' is gestart/herstart", event.getApplicationContext()
.getId());
logJvmSettings();
}
} catch (final ApplicationContextException ex) {
LOGGER.error("Fout bij het opstarten van de applicatiecontext bij event {}", event.toString(), ex);
}
}
BrpApplicatieStartListener.java 文件源码
java
阅读 18
收藏 0
点赞 0
评论 0
项目:OperatieBRP
作者:
评论列表
文章目录