Hi all. I'm trying to figure out the best way to load a spring bean, depending on a system environment variable being set. I realize that this would be a simple task using profiles, but unfortunately I'm using Spring 2.5. So here is the bean definition in my XML file:
Basically, I'm looking for a way to only load that bean based on the existence of a system environment variable, otherwise, ignore it. I've been looking into the use of BeanPostProcessors and BeanFactoryPostProcessors, but can't quite put my finger on the solution. Any help on this would be greatly appreciated. Thanks!Code:<bean id="updateBlogEntryListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="concurrentConsumers" value="1"/> <property name="connectionFactory" ref="jmsConnectionFactory"/> <property name="destinationName" value="queue/updateBlogEntryQueue"/> <property name="messageListener" ref="updateBlogEntryMessageHandler"/> <property name="transactionManager" ref="transactionManager"/> <property name="sessionTransacted" value="true"/> <property name="destinationResolver" ref="destinationResolver"/> </bean>


Reply With Quote
