I have the same problem than "aaime". I use Spring's RMI facilities in client and server sides and that works very fine. But now, I want my client "listens" remote service events (like "aaime" callbacks). I do this using simple RMI API (exporting the listener through UnicastRemoteObject and extending listener interface from java.rmi.Remote), but that way dirties my Java code with RMI API.
I can't figure out how can I do that using Spring's RMI facilities.
My client-side-context is:
Code:
<beans>
<bean id="client" class="my.spring.sample.rmi.client.Client" init-method="init">
<property name="service"><ref bean="accountService"/></property>
<property name="serviceListener"><ref bean="serviceListener"/></property>
</bean>
<bean id="accountService" class="org.springframework.remoting.rmi.RmiProxyFactoryBean">
<property name="serviceUrl"><value>rmi://localhost:1099/AccountService</value></property>
<property name="serviceInterface"><value>my.spring.sample.rmi.server.AccountService</value></property>
</bean>
</beans>
My server-side-context is:
Code:
<beans>
<bean id="accountService" class="my.spring.sample.rmi.server.AccountServiceImpl"/>
<bean id="accountServiceExporter" class="org.springframework.remoting.rmi.RmiServiceExporter">
<property name="serviceName"><value>AccountService</value></property>
<property name="service"><ref bean="accountService"/></property>
<property name="serviceInterface"><value>my.spring.sample.rmi.server.AccountService</value></property>
<property name="registryPort"><value>1099</value></property>
</bean>
</beans>
Anybody can help me?
Thanks in advance and sorry for my english.