Announcement Announcement Module
Collapse
No announcement yet.
RMI as bean injected Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • RMI as bean injected

    Am having two applications:

    Application One:
    <bean id="myBean"
    class='org.springframework.remoting.rmi.RmiProxyFa ctoryBean'>
    <property name="serviceUrl">
    <value>rmi://${myServiceUrl}/MyObject</value>
    </property>
    <property name="serviceInterface">
    <value>MyClassNameWithPath</value>
    </property>
    <property name="lookupStubOnStartup">
    <value>false</value>
    </property>
    <property name="refreshStubOnConnectFailure">
    <value>true</value>
    </property>
    </bean>

    I get myBean bean object using
    ApplicationContext.getBean("myBean")
    and pass it other service.
    If for some reason myServiceUrl fails and restarts, the above setting is able to reconnect it.

    Application Two:
    <bean id="myBean"
    class='org.springframework.remoting.rmi.RmiProxyFa ctoryBean'>
    <property name="serviceUrl">
    <value>rmi://${myServiceUrl}/MyObject</value>
    </property>
    <property name="serviceInterface">
    <value>MyClassNameWithPath</value>
    </property>
    <property name="lookupStubOnStartup">
    <value>false</value>
    </property>
    <property name="refreshStubOnConnectFailure">
    <value>true</value>
    </property>
    </bean>
    Here I inject the RMI bean
    <bean id="otherBean"
    class="otherBeanClassNameWithPath"
    p:myBean-ref="myBean"
    />
    But if now myServiceUrl fails and restarts, my application is not able to reconnect to the server.
Working...
X