ctx.registerPrototype("testService2", ExtendedTestService.class, new MutablePropertyValues());
MutablePropertyValues mpv = new MutablePropertyValues();
mpv.addPropertyValue("serviceLocatorInterface", TestServiceLocator3.class);
mpv.addPropertyValue("serviceMappings", "=testService1\n1=testService1\n2=testService2");
ctx.registerSingleton("factory", ServiceLocatorFactoryBean.class, mpv);
ctx.refresh();
TestServiceLocator3 factory = (TestServiceLocator3) ctx.getBean("factory");
TestService testBean1 = factory.getTestService();
TestService testBean2 = factory.getTestService("testService1");
TestService testBean3 = factory.getTestService(1);