Announcement Announcement Module
Collapse
No announcement yet.
passing remote objects via Spring RMI classes Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • passing remote objects via Spring RMI classes

    Hi,

    Iím trying to do something similar to what is described in Jira at this link:

    http://jira.springframework.org/browse/SPR-982

    Essentially, Iíd like to create a remote object on a server that contains remote services as instance variables. Iím exporting this remote object on the server using RmiServiceExporter and calling it from the client using RmiProxyFactoryBean. This works fine. However, Iíd like to be able to get a reference to the remote services (contained within the remote object) on the client. Iíve been able to create the remote services within the remote object as proxys using RmiProxyFactoryBean, but when I call a method on the remote object from the client to return the proxy to one of the remote services, I get an exception saying that RmiProxyFactoryBean is not serializable.

    Iíve done a lot of web searches on this and also looked through the Spring Framework source code for classes RmiServiceExporter and RmiProxyFactoryBean, but I still have not been able to figure out a way to do this using Spring. The alternative is to do it using RMI classes, but that is definitely not my first choice.

    Iíve found the links below related to this issue, and based on what Iíve read so far, my understanding is that this cannot be done in a clean way with Spring. But before I give up on this effort, Iíd like to get confirmation of that. 

    http://forum.springsource.org/showth...n+serializable

    http://forum.springsource.org/showthread.php?t=14684


    Any help on this will be greatly appreciated!

    Thanks,

    Pat

  • #2
    I attach a working example to the old Jira issue https://jira.springsource.org/browse/SPR-982

    The code that I'm using is on
    http://sourceforge.net/p/jdal/code/c.../remoting/rmi/

    Export the client callback with provided RmiServiceExporter and pass the object returned by RmiServiceExporter.getRemoteService() to the remote server.

    If you don't want that client bind to the registy, set the DummyRegistry as registry on RmiServiceExporter.

    Cheers
    Last edited by chelu; Oct 19th, 2012, 06:23 AM.

    Comment


    • #3
      Now, I need it working for HttpInvokers too, so I try a new approach.
      • Add RemotetClient interface to Proxies created by ProxyFactoryBeans that create a serializable reference with remote data.
      • Add a new RemoteInvocationFactory that look for RemoteClients on arguments and replace it with references
      • Add a new RemoteInvocationExecutor that exchange references with Proxies again on the other side.

      code is on http://sourceforge.net/p/jdal/code/c...rtin/remoting/ if some want want to test, use or improve it.

      Cheers

      Comment

      Working...
      X