aspose file tools
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes GUI to stop RMI server? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "GUI to stop RMI server?" Watch "GUI to stop RMI server?" New topic
Author

GUI to stop RMI server?

Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 187
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

Joined: Nov 07, 2004
Posts: 53
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

Joined: Jul 15, 2006
Posts: 360
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.


SCJP, SCJD,SCWCD,SCDJWS,SCEA 5 MCP-C#, MCP-ASP.NET - http://www.khaledinho.com/
Life is the biggest school
josine wilms
Ranch Hand

Joined: Jan 23, 2006
Posts: 45
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.



SCJP 1.4<br />SCWCD 1.4<br />SCJD <br />SCEA (new version) Work in progress...
Shannon Sims
Ranch Hand

Joined: Jul 03, 2003
Posts: 187
Thanks Kelly, Khaled and Josine for your reply. Khaled and Josine, the system.exit(0) worked great!

Thanks again!
 
I agree. Here's the link: jrebel
 
subject: GUI to stop RMI server?
 
Similar Threads
Applet with RMI ,how to place into Tomcat?
Stop EJB Processing
Stopping RMI programatically
about the stop rmi
RMI Question another one ?