An RMIPRoxyFactoryBean factory in Spring?
Posted
by Robert Munteanu
on Stack Overflow
See other posts from Stack Overflow
or by Robert Munteanu
Published on 2009-08-12T09:14:56Z
Indexed on
2010/06/09
13:22 UTC
Read the original article
Hit count: 177
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.
© Stack Overflow or respective owner