 <p>Bean profiles could be great fit for this - based on the "active" profile let one or the other bean be created. </p> <p>Somewhat of an older article, but is still a good reference to profiles in Spring 3.1- <a href="http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/" rel="nofollow">http://blog.springsource.com/2011/02/11/spring-framework-3-1-m1-released/</a></p>