PDA

View Full Version : RMI - keeping serviceUrl dynamic?



de_tom
Apr 4th, 2006, 08:54 AM
Hi,

I've got a number of services exposed via RMI. My RMI clients are Spring proxies (RmiProxyFactoryBean) that specify the location (serviceUrl) of the remote service. Right now I am declaring the serviceUrl of each client individually (e.g. rmi://my.ip.he.re:9000/entityManager) but I wonder whether there is a better way to do this. Isn't it possible to store the url once and then reuse it? Obviously the serviceName has to be set for each client bean but it would be nice to store the ip and the port somewhere else.

Regards,
Tom

Andreas Senft
Apr 4th, 2006, 08:58 AM
You could use a PropertyPlaceholderConfigurer to outsource url and port to a properties file. Thus you could write, for example, ${url}:${port}/entityManager.

Regards,
Andreas

de_tom
Apr 4th, 2006, 09:21 AM
Hi Andreas,

thanks for your fast reply - the PropertyPlaceholderConfigurer works like a charm!

Regards,
Tom