Do they implement a common interface?
You can do a number of things. If you are using
java config just @Autowire in Springs Environment and return the bean you want
With XML you can do the same thing just use SPEL
Or you could use a factory bean. You can google for the XML equivalent if you are not familiar with them
http://blog.springsource.org/2011/08/09/whats-a-factorybean