Destroy RMI Registry programmatically

Discussion in 'Java' started by Volker Raum, Feb 14, 2007.

  1. Volker Raum

    Volker Raum Guest

    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
    Volker Raum, Feb 14, 2007
    #1
    1. Advertising

  2. Volker Raum

    Esmond Pitt Guest

    Volker Raum wrote:
    > 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().
    Esmond Pitt, Feb 15, 2007
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HK
    Replies:
    1
    Views:
    3,604
    Cowboy \(Gregory A. Beamer\)
    Apr 1, 2004
  2. Replies:
    0
    Views:
    729
  3. Jan Schulze
    Replies:
    1
    Views:
    558
    Esmond Pitt
    Mar 26, 2005
  4. Replies:
    1
    Views:
    6,446
    Esmond Pitt
    May 24, 2005
  5. Ook
    Replies:
    2
    Views:
    313
Loading...

Share This Page