Search code examples
javarmi

separate rmiregistry and server application


I'm developing a basic application that starts the rmiregistry at the server:

try {
            // create the registry and bind the name and object.
            registry = LocateRegistry.createRegistry(thisPort);
            registry.rebind("rmiServer", this);
        }
        catch (RemoteException e) {
            throw e;
        }

I want to run the registry on another machine. Is it possible to separate this?


Solution

  • I want to run the registry on another machine. Is it possible to separate this?

    Its possible. If the registry is running on a different machine, you can locate it using LocateRegistry.getRegistry(host, port)