Results 1 to 2 of 2

Thread: Durability of Remote EJB proxy

  1. #1

    Default 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. #2

    Default

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •