For RMI on server-side, do we need to start rmiregistry program, or just call LocateRegistry.createRegistry? If both are possible, what are the advantages and disadvantages?
For RMI on server-side, do we need to start rmiregistry program, or just call
Share
They’re the same thing…
rmiregistryis a separate program, which you can run from a command line or a script, whileLocateRegistry.createRegistrydoes the same thing programatically.In my experience, for ‘real’ servers you will want to use
rmiregistryso that you know it’s always running regardless of whether or not the client application is started.createRegistryis very useful for testing, as you can start and stop the registry from your test as necessary.