I have several services which export an RMI interface.
They used to offer this by creating their own registry (with LocateRegistry.createRegistry
) and binding it there. However, that became impossible when the services were moved to run as separate applications in the same VM (Tomcat), because for some reason only one registry can be present there.
I worked around this by using a central registry for all the services. Even then, I'm not really interested in the multi-object registry role of a registry, just its entry point facilities. A central registry, however, introduces more complexity (e.g. it must be started first, it must have the interfaces of services it registers).
Is there a way to bring back the situation where each service indepently offers an entry point to its RMI interface, while having them run in the same VM (which is a hosting detail, not part of the design)?