4.9.2 The Task

You are supplied with a GUI and some skeleton code to fill out to provide the remote method invocation in staticInvocation.zip.

The full code is available in fullStaticInvocation.zip

  1. Choose a port number on which your invocation server will listen.
  2. I suggest implementing the static invoke method in StaticInvocation initially, and calling this directly from the GUI, rather than using the server. You will need to clean up some loose ends to enable the classes to compile.
  3. Implement the client and server socket code.

When you have finished, reflect upon what you have achieved. Your server can invoke any method. This enables the RMI system to provide a universal skeleton for any remote object on the server side. However, are there any security holes?

Think about the power of Object Serialization in distributing Java both in time and space. Can you see how resources can be saved by serializing objects and reactivating them later?

Ian Wakeman 2005-02-22