List of usage examples for org.springframework.integration.config IdGeneratorConfigurer generatorContextId
Set generatorContextId
To view the source code for org.springframework.integration.config IdGeneratorConfigurer generatorContextId.
Click Source Link
From source file:org.springframework.integration.config.IdGeneratorConfigurer.java
public synchronized void onApplicationEvent(ApplicationContextEvent event) { ApplicationContext context = event.getApplicationContext(); if (event instanceof ContextRefreshedEvent) { boolean contextHasIdGenerator = context.getBeanNamesForType(IdGenerator.class).length > 0; if (contextHasIdGenerator) { if (this.setIdGenerator(context)) { IdGeneratorConfigurer.generatorContextId.add(context.getId()); }/*w ww . j av a2s. c om*/ } } else if (event instanceof ContextClosedEvent) { if (IdGeneratorConfigurer.generatorContextId.contains(context.getId())) { if (IdGeneratorConfigurer.generatorContextId.size() == 1) { this.unsetIdGenerator(); } IdGeneratorConfigurer.generatorContextId.remove(context.getId()); } } }