Sunday, March 20, 2005

Java RMI (could it be better?)

Having developed quite a few systems using RMI as remoting (RPC) I often find myself thinking - is this really the best solution for RPC between two java VM's? I tend to use RMI as its amazingly simple to write an interface which extends Remote, write an implementaion which extends UnicastRemoteObject, bind it using Naming and viola, you have yourself a remote accessible object. But RMI comes with a whole bunch of obstacles, mainly when dealing with limited environments (firewalls, routers, ports etc.) and callbacks - dont even get me started on callbacks....

Anyways - I started to think about a somewhat simple RMI replacement much more similar to the CORBA ORB. The client and the server both have an ORB like service/server to which remote capable objects are bound (remote stubs are still looked up in whatever naming service). The local stub will connect to the local ORB, send request and receive responses thru this ORB like service. The ORB will connect to the ORB running on the remote VM (server). By keeping this connection open, callbacks can be handled thru this connection also. Pretty simple stuff I think, I am but to make an implementation, later!!! ;-)


Post a Comment

<< Home