Remote Method Invocation (RMI) - I need to run rmiregistry automatically.. any one help me...

hi I am new to RMI, i created a simple RMI concept and it is working fine. I need to start rmiregistry by manually. Is there way to run rmiregistry as automatic when i execute the server program.. please clear me..
[235 byte] By [Ragav_Msca] at [2007-11-26 23:02:29]
# 1
java.rmi.registry.LocateRegistry.createRegistry()
ejpa at 2007-7-10 13:53:04 > top of Java-index,Core,Core APIs...
# 2

To start the rmiregistry programmatically:

LocateRegistry.createRegistry(1099);

To stop it programmatically:

UnicastRemoteObject.unexportObject(registry, true);

However, you can also do it "dirty" (I tried this successfully):

Runtime.getRuntime().exec(rmiRegistry);

// rmiRegistry is e.g. ".../rmireghistry.exe"

The benefit of the last method is that "rmiregistry" is its own process which you can monitor (e.g. TaskManager in Windows) and kill seperatly if necessary during debugging.

Sir_Galahada at 2007-7-10 13:53:04 > top of Java-index,Core,Core APIs...
# 3
It can't be necessary to kill separately a process that you can not resurrect separately.
_dnoyeBa at 2007-7-10 13:53:04 > top of Java-index,Core,Core APIs...