Hi Stuart
The class referred to below might be what you are looking for...
http://static.springframework.org/sp...api/index.html
The Javadocs are (to my mind) fairly comprehensive; to tailor them to fit your specific use case, the following configuration would effect what you want.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans
xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:lang="http://www.springframework.org/schema/lang"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/lang http://www.springframework.org/schema/lang/spring-lang.xsd">
<bean name="1" class="forums.StubSupplierService">
<property name="name" value="First"/>
</bean>
<bean name="2" class="forums.StubSupplierService">
<property name="name" value="Second"/>
</bean>
<bean name="3" class="forums.StubSupplierService">
<property name="name" value="Third"/>
</bean>
<bean id="accountingService" class="forums.DefaultAccountingService">
<property name="supplierServiceFactory">
<bean class="org.springframework.beans.factory.config.ServiceLocatorFactoryBean">
<property name="serviceLocatorInterface" value="forums.ISupplierServiceFactory"/>
</bean>
</property>
</bean>
</beans>
With classes and interfaces like this...
This is the main 'service locator / factory' referred to in your posts; I even kept the same name 
Code:
package forums;
public interface ISupplierServiceFactory {
ISupplierService create(int supplierId);
}
And this is the thing that it makes; I also kept the same name and bunged in some throwaway method.
Code:
package forums;
public interface ISupplierService {
void execute();
}
A grungy little stub implementation of the above interface.
Code:
package forums;
public class StubSupplierService implements ISupplierService {
private String name;
public void setName(String name) {
this.name = name;
}
public void execute() {
System.out.println(name);
}
}
This is the class into which you would inject an instance of the ISupplierServiceFactory (Spring will supply an implementation of the ISupplierServiceFactory) .
Code:
package forums;
public class DefaultAccountingService implements AccountingService {
private ISupplierServiceFactory supplierServiceFactory;
public void setSupplierServiceFactory(ISupplierServiceFactory supplierServiceFactory) {
this.supplierServiceFactory = supplierServiceFactory;
}
public void someBusinessLogic(Long serviceId) {
ISupplierService supplierService = this.supplierServiceFactory.create(serviceId.intValue());
supplierService.execute();
}
}
And here's some driver code to exercise the above code and configuration.
Code:
import forums.AccountingService;
import forums.ISupplierService;
import org.springframework.context.support.AbstractApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
public final class Boot {
public static void main(final String[] args) throws Exception {
AbstractApplicationContext ctx = new ClassPathXmlApplicationContext(
new String []{"beans.xml"}, ISupplierService.class);
ctx.registerShutdownHook();
AccountingService service = (AccountingService) ctx.getBean("accountingService");
service.someBusinessLogic(new Long(1));
}
}
The resulting output from the execution of the above program would be the glorious String 'First'. Hardly thrilling, but I guess (hope) it demonstrates runtime argument factory usage within Spring (via interfaces).
The benefits of this approach are that you are only tasked with writing an interface; Spring's IoC container supplies the implementation (nothing prevents you from writing your own implementation, so you are not locked in architecturally). You are not limited to using just ints and stuff as the bean name / factory argument... the toString() mehtod of the argument will be used to get a bean name. Unfortunately this is not configurable at the moment (i.e. there is no strategy interface so that one can plug in one's own implementation), but if you have a look at the source code for the SLFB class you'll see that it would be fairly easy to either a) roll your own custom implementation along the same lines, or b) (better) create a JIRA issue asking for any customisation to be rolled into the Spring core.
Hopefully this is helpful 
Merry Christmas
Rick