How do I dynamically register a remote object to the RMI registry?

Denis Balazuc

There is many ways you could do this.

Mostly you will need to dynamically load and instanciate a class (using Class.forName()), and then register it within the RMI registry.

To achieve this, you need :
--The classname you want to instantiate
--The remote Object name under which the instance will be registered.

To instruct your RMI server to register new objects, you could use a server socket that accepts connections with which you send directions for registering classes. Another idea would be to use another RemoteObject which only service would be to load/create and register other Remote Objects through a register(String name, String classname) method.

You could also have a property file which contain <object name>=<object classname> and that will be parsed when starting your RMI server.