A couple of weeks ago I read a very interesting article about a framework called "JBoss Remoting". The prupose of JBoss Remoting is to use the same API for making remote invocations with different network protocols. It allows to make synchronous and asynchronous remote calls, push and pull callbacks, and automatic discovery of remoting servers. That means, developing a distributed application using JBoss Remoting, you don't have to care about the underlying network protocol. You can use RMI as well as a simple socket connection, without changing one line of code.
Since I really like the idea of JBoss Remoting, I made a small example. It consists of a server and a client application. For further details, check the readme file that comes along with my example. It is available through bittorrent and my download site.