Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Shutting down RMI  RSS feed

 
Roy Mallard
Ranch Hand
Posts: 53
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program shuts down properly in standalone mode, but when I run it in client or server mode the following threads keep running for a couple of minutes after the GUI disappears:
Timer-0
Java2D Disposer
AWT-Windows
DestroyJavaVM
TimerQueue

I think this is because I am using RMI. How am I supposed to shut down RMI elegantly so that the whole program exits quickly?
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Roy

There is no way to do this in a elegant way.You can unbind th remote objects, remove them from the Run-Tine but this is still not enought.
I do this with the "System.exit"

Regards M.
 
Oliver Weikopf
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All I do when exiting the server is registry.unbind(). But even when I leave that out, and do nothing at all to finish RMI, no threads keep running. So I'd doubt that your problem is RMI-related.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!