PDA

View Full Version : SLSB support: dynamic JNDI settings


baptiste
Nov 25th, 2004, 04:24 AM
Hi,

I work on a distributed application in which each client (Swing-based GUI) can access several remote appservers implementing SLSBs. I'd like to leverage Spring SLSB support by using SimpleRemoteStatelessSessionProxyFactoryBean.

My problem is that clients receive the system topology (including the JNDI settings of the servers) at runtime. Is there a way to dynamically set these properties, in order for the Spring proxies to call the right appserver ?

Thanks for answering. Regards,
Baptiste

ram_2000
Dec 10th, 2004, 11:05 PM
Delay your initialization of Spring (ApplicationContext or BeanFactory) to after the client receives the topology, then you can easily implement a BeanFactoryPostProcessor that replaces tokens (something like ${jndi_url} ) in the definition file at runtime.

See PropertyPlaceholderConfigurer.java for a sample.