I'm currently using a Spring RmiProxyFactoryBean
to access remote services. Since requirements have changed, I need to specify at runtime a different host - there can be many of them - , but the remoteServiceInterface
and the non-host components of the remoteServiceUrl
remain the same.
Conceptually speaking, I'd see a bean definition similar to:
<bean class="org.springframework.remoting.rmi.RmiProxyFactoryBeanFactory">
<property name="serviceInterface" value="xxx"/>
<property name="serviceUrl" value="rmi://#{HOST}:1099/ServiceUrl"/>
</bean>
which exposes a
Object getServiceFor(String hostName);
Is there such a service available with Spring? Alternatively, do you see another way of doing this?
Please note that the host list will not be known at compile or startup time, so I can't generate it in the xml file.