• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

RMI - networked / non-networked mode

 
Laura Williamson
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Unsure on the following:

"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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Wei-ju Wu
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

all advice appreciated

thanks

Laura
 
Olena Golub
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Laura,

I would recommend you to look at this topic: RMI implementation

It has helped me to understand the RMI integration. Hope that helps you also!
Olena
 
Lara McCarver
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic