"The operating mode is selected using the single command line argument that is permitted."
How does this work? java GUI is the command that kicks off my program - can this take an additional argument? Thanks for yr help. Laura
Laura Williamson
Ranch Hand
Joined: Apr 28, 2004
Posts: 44
posted
0
Ok so I am good with passing in an arg at the command line - but does the program itself need to start the rmiregistry and server, or would the user do that manually? ie. rmiregistry & java HelloServer &
I assume that the user at the server end would start these manually, so we are not expected to code them?
Wei-ju Wu
Ranch Hand
Joined: Feb 16, 2005
Posts: 147
posted
0
Hi Laura,
which assignment do you work on. Usually the application is started with something like
so your parameter will determine which mode your application will be run in. The GUI you have to display will depend on the run mode.
Wei-ju
"The UrlyBird catches the certificate. And he's gonna FlyByNight"<br /> <br />SCJP 1.2/5.0, SCJD, SCBCD, SCWCD, SCEA
Wei-ju Wu
Ranch Hand
Joined: Feb 16, 2005
Posts: 147
posted
0
Originally posted by Laura Williamson: Ok so I am good with passing in an arg at the command line - but does the program itself need to start the rmiregistry and server, or would the user do that manually? ie. rmiregistry & java HelloServer &
I assume that the user at the server end would start these manually, so we are not expected to code them?
I had a similar problem, that I posted here and eventually found the solution by myself. Have a look on the LocateRegistry class, you can have it created by your server application which will save a lot of money for aspirine :-)
Laura Williamson
Ranch Hand
Joined: Apr 28, 2004
Posts: 44
posted
0
hmm thanks for your replies. i am still a bit confused. i am doing boggit and scraper..i have coded my GUI and database access code, works fine as standalone. then i have coded a simple RMI program separately. Unsure how to integrate them...should there not just be one GUI? Does the RMI code not just call networked data code?
It has helped me to understand the RMI integration. Hope that helps you also! Olena
SCJP 1.4<br />SCJD 1.4 (in progress)
Lara McCarver
Ranch Hand
Joined: Dec 09, 2003
Posts: 118
posted
0
I am just starting the B&S assignment, so I still have a lot of questions about the requirements. Here is what I think is supposed to happen. You are supposed to have one jar file for all your code. It is supposed to include both the server code and the GUI (client) code. The manifest file indicates which class to start. So say your "main" class is "ExamProject". If you type:
java ExamProject server
then the main() method inside ExamProject is supposed to create all the objects that you need for the server. If you start it like this:
java ExamProject
then the main() method inside ExamProject is supposed to create JFrames and JPanels and all the other objects that you need for your GUI.
I noticed in the Max book that they show a java method which will start up the rmi registry. Hopefully, that would have no ill effect if it is already started, so why not include it in your server code?
Edit: actually you would use the name of your jar file, not ExamProject, but hopefully the idea is clear. [ May 06, 2005: Message edited by: Lara McCarver ]