Destroy RMI Registry programmatically

V

Volker Raum

Hi everyone,
i got a little question about the Java RMI Registry.

In our Software use a RMI Registry.
Instead of doing this by starting an rmid we start the registry directly in the Code.

Registry registry = java.rmi.registry.LocateRegistry.createRegistry(registryPort);

Everything works 100% perfectly.

The only thing we would like to do is to destroy this factory again programmatically.
Any Ideas ?

Volker
 
E

Esmond Pitt

Volker said:
Hi everyone,

Registry registry =
java.rmi.registry.LocateRegistry.createRegistry(registryPort);

The only thing we would like to do is to destroy this factory again
programmatically.

UnicastRemoteObject.unexportObject(registry, true);

This only works if 'registry' is the result returned by
LocateRegistry.createRegistry(), and specifically *not* by
LocateRegistry.getRegistry().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top