Hello, Mark, Oleg & Dave
I've caught some bugs in Control Bus components.
1. If I using the <groovy:control-bus input-channel="controlBusChannel"/>, GroovyControlBusFactoryBean "scolded" me that I have some abstract beans. So, I think the code of ManagedBeansScriptVariableGenerator.generateScript Variables must be like:
2. I cant access to FactroyBeans directly from SpEL. For example:Code:for (String name : this.beanFactory.getBeanDefinitionNames()) { BeanDefinition def = this.beanFactory.getBeanDefinition(name); //THIS if (def.isAbstract()) continue; // AND THIS Object bean = this.beanFactory.getBean(name);
Because the SpEL doesn't understand sombol "&". No words...HTML Code:<transformer input-channel="refreshGlobalSettingsChannel" output-channel="controlBusChannel" expression="'@&globalSettings.refresh()'"/>
And some question out of thread:
1. How can I access directly to BeanFactory(ApplicationContext) from SpEL?
2. How can I make my singleton Beans refreshable?
I've wrote some class:
But I hope there are some elegant solutions in the Spring...Code:@ManagedResource class RefreshableFactoryBean<T> implements FactoryBean<T>, InitializingBean { @Autowired BeanFactory beanFactory ExpressionFactoryBean delegate volatile T object Class<T> objectType String expressionString EvaluationContext evaluationContext @ManagedOperation void refresh() { if (delegate) object = delegate.object.getValue(evaluationContext) } boolean isSingleton() { return true } void afterPropertiesSet() { if (expressionString) { delegate = new ExpressionFactoryBean(expressionString) delegate.afterPropertiesSet() evaluationContext = new StandardEvaluationContext() evaluationContext.beanResolver = new BeanFactoryResolver(beanFactory) } refresh() } }
thanks in advance,
Artem Bilan
P.S. Sorry for mistake in the name of Thread. Disgraced...


Reply With Quote
