@Override public void start() { this.context = new ClassPathXmlApplicationContext(new String[] {CORE_CONFIG, PLUGIN_CONFIGS}, false); context.setId(this.id); updateLoggerFilename(); Assert.notNull(launcherContext, "no Container launcher ApplicationContext has been set"); ApplicationContext globalContext = launcherContext.getParent(); Assert.notNull(globalContext, "no global context has been set"); context.setParent(globalContext); context.registerShutdownHook(); context.refresh(); this.containerRunning = true; context.publishEvent(new ContainerStartedEvent(this)); if (logger.isInfoEnabled()) { logger.info("started container: " + context.getId()); } }
@Override public void initialize(ConfigurableApplicationContext applicationContext) { ContainerAttributes containerAttributes = applicationContext.getParent().getBean(ContainerAttributes.class); applicationContext.setId(containerAttributes.getId()); }
@Override public void initialize(ConfigurableApplicationContext applicationContext) { applicationContext.setId(getApplicationId(applicationContext.getEnvironment())); }