I'm new to Spring, and trying to convert a Swing client that is currently using EJBs on a remote server. I have the basic EJB stuff working via SimpleRemoteStatelessSessionProxyFactoryBean.
Things seem to work fine when I get this bean from the ApplicationContext, and then use it as a "foo.HealthMonitor". However, I've discovered that I cannot make it a prototype. This makes sense if the bean *is* a factory, but when I get the bean, I'm not using it *as* a factory, but rather as "service object". This confuses me. Can someone explain this too me.
<bean id="HealthMonitor" class="org.springframework.ejb.access.SimpleRemoteStatelessSessionProxyFactoryBean" lazy-init="true">
<property name="jndiName" value="HealthMonitor" />
<property name="businessInterface" value="foo.HealthMonitor" />
<property name="jndiTemplate" ref="jndi"/>
I'm further concerned, because if I'm using DI, I will freqently have hold of a Remote proxy for an extended period of time during which the remote service may "come and go". In my experience, once the server goes down, the proxy is useless. I think there should be an Aspect that could 'reconnect', and the retry the method call. Is there such?