• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

RMI - networked / non-networked mode

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic