My project framework is designed in such a way that I don't have access to Springs ApplicationContext. However, I would like to inject beans based on a system property. If the property is set to true, then inject all the beans, else inject none. Is this a possibility. Something like the below. BTW, Spring version is 3.0
<!-- all beans -->
<bean></bean>
<bean></bean>
<bean></bean>
<bean class ="org.springframework...PropertyPlaceHolderConfigurer>
<property name = "properties"
<value>
OBJECT_INSTANCE_ID =0
</value>
</property>
<bean>
In short the property is read using PropertyPlaceHolderConfigurer. All other beans should load based on value OBJECT_INSTANCE_ID. The property is defined in a property file located at /etc/../system.property