What is the best way of extending spring application context? <p>I need to extend spring applicatioContext xml file with new beans definitions and then add references to them to list, which is a property of one bean: Basic applicationContext xml file: </p> <pre><code>&lt;bean id="myBean" class="com.example.MyBean"&gt; &lt;property name="providers"&gt; &lt;list&gt; &lt;ref bean="provider1"&gt; &lt;/list&gt; &lt;/property&gt; &lt;/bean&gt; &lt;bean id="provider1" class="com.example.Provider"&gt; </code></pre> <p>Depends on instance of application I have different providers, so I need to add them to the list. Now I have the additional beans definitions in database and use <code>BeanFactoryPostProcessor</code> to add them to the context and then add references to them to the list of providers. But I use <code>@Transactional</code> annotation on <code>myBean</code> and automatic transaction management (<code>tx:annotation-driven</code>) and because of using <code>BeanFactoryPostProcessor</code> the transaction annotations are not processed. </p> <p>So I need another way to extend the application context and then the list of providers. What can I use? </p> <p>My idea is to have xml file which at the beginning is empty and then fill it by data from database and then import it somehow in applicationContext. Is it possible?</p> <p>Thanks for your help </p>