Announcement Announcement Module
Collapse
No announcement yet.
Durability of Remote EJB proxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Durability of Remote EJB proxy

    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.

    Code:
     <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"/>
    	</bean>
    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.

    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?

    Thanks David

  • #2
    OK, I think I've got this figured out.

    1) The first point of confusion is because of the FactoryBean interface.

    2) For the second concern, setting refreshHomeOnConnectFailure to true seems to fix it.

    Did I get it right?

    Comment

    Working...
    X