Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GUI to stop RMI server?

 
Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Unless I'm blind as a bat (which I can sometimes be), it doesn't state anywhere in the B&S document to programmactically stop the RMI server via a UI or from a command line. I manually stop the rmi server using "Ctrl-C" via the Command prompt window. Has anyone failed or will I fail if I don't provide this functionality? Will I lose points if I don't?

Thank you.
 
Kelly Wood
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can programatically start up a RMI registry, but I have yet to find a way to stop it programatically. My assignment spec did not mention about a stop function so I decided not to do it.
 
Khaled Mahmoud
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I have noticed is that when you start the RMI registry
programatically, it will run in a new thread.
When you exit the GUI form,if you type System.exit(0),all threads belonging to the running applicaion, including the RMI registry will be killed.

For my assignment,as long as the GUI is running the server and the RMI registry will be running too.If the user chose to exit the GUI, will shutdown the RMI registry and the server.
 
josine wilms
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just make an "exit" button on your GUI, and add an ActionListener.

Do something like this:

exitButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
System.exit(0);}

I think it looks nice and logical.

 
Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Kelly, Khaled and Josine for your reply. Khaled and Josine, the system.exit(0) worked great!

Thanks again!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic