RMI on-the-fly

Exposing methods within an RMI-server is a common requirement in distributed applications. Each method requires a definition in an interface extending Remote (for use by the clients) and an implementation extending UnicastRemoteObject implementing this interface (for the server side). Usually, the implementation simply invokes the original method to be exposed.
However, larger applications with lots of methods make this a tedious and error-prone process. Fortunately, wurblets can do that automatically!

Analyze and Generate

A wurblet requires access to a method's signature so that it can create the necessary RMI code. This is accomplished in two steps:

The original method with the added annotation @Analyze and the wurblet RemoteMethod looks like this:
the original method

The generated interface code:
generated interface

The generated implementation code:
generated implementation

Thus, making a method RMI-aware gets pretty easy: just add an annotation and a wurblet anchor. If the method's signature change, the RMI-code is changed automatically.

Notes

to the next example... >