• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Stopping RMI programatically

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

Do you know if there is a way to stop the RMI service on the server side programatically?

I started RMI by creating a Registry with LocateRegistry.createRegistry(). I traced the program with jconsole. It seems like whatever I do (unbinding the service, unexporting the exported service object, even unexporting the registry itself), the RMI Accept-<port> thread(s) don't stop. Do I have to exit the application to stop the RMI threads, or have I just missed something?
 
Ranch Hand
Posts: 291
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The only way to end the RMI Server is with System.exit(). There are many non-daemon threads alive, so you must end the process yourself.
 
Ranch Hand
Posts: 1170
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have to unexport your server. I do not know exactly how you can stop the registry if you started it programatically. But if you do not start the registry than it will still be listening.

So which exactly is listening, the registry or your server?
 
David Nemeskey
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Edward Harned: thanks for the answer. Too bad; I think this is a serious feature hole in RMI, then.

Mr. C Lamont Gilbert: As I said in the topic starter, I unexported both. And I think nothing is listening, just the "RMI Accept-Xxxx" threads are running (and who knows what other resources RMI needs). Unfortunately it seems that there is no way to write a flexible RMI server (with reconfigurable ports). Or, rather, not this way.

For reference, here is the code. Never mind the method indices, I had some others as well to test it

[ April 26, 2007: Message edited by: David Nemeskey ]
 
Try 100 things. 2 will work out, but you will never know in advance which 2. This tiny ad might be one:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic