• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Running server/client separately in runme.jar

 
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The requirements seem to repeatedly insinuate the fact that the client and the server should be executable on two separate JVMs possibly on two separate machines. This implies starting two different programs through java -jar <file> [<mode>].

However, my deliverables seem to clearly state that only one archive, runme.jar is to be submitted as the sole executable. As far as I know, one jar can only have one main class attribute. Anybody have any idea how I'm supposed to get the server and client started separately through the same jar? Is this a problem with the requirements or am I missing something? Thanks in advance...
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The assignment is correct.

You're assignment should describe command args you can must support for executing the assignment in various modes.

This means your main class will have to handle these args and be able to launch your application based on the command args


Also you will need to make an executable jar file. Try googling this for how to do so
 
Reza Rahman
author
Posts: 580
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, so I think you are saying the following:

1. The Main-Class in the jar should really inspect the <mode> operator and dtermine which part of the project to run. Such as:

a. if <mode> = "server" then run the database server.
b. if <mode> = "alone" then run the client GUI using the database in
local mode. In this case, do you think the options panel should still
allow the user to change their mind?
c. if <mode> is not specified, run the client in network mode. Same
question as above here.

This certainly would cover all the possibilities, does this seem sensible? Thanks for the input...
 
Ranch Hand
Posts: 808
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You got it. The jar could be distributed among n machines, whether the machines are real or virtual, and the user would start each copy of the jar in whatever mode the user needed, such as server or standalone on the server, client on any other machines that want to access the server's database...
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"The mode flag must be either "server", indicating the server program must run, "alone", indicating standalone mode, or left out entirely, in which case the network client and gui must run"

Ok, this is how I interperted it:

1. If mode flag = "server", "only" run the server/database and nothing-else. This indciates standalone.

2. If mode flag = "client without networking", "only" run the client/gui/database without the server. This means client/gui/database all runs on the same machine. No networking.

3. If mode flag = "client with networking", run the client/gui/server/database. This means client/gui/server/database can run on different JVMs and machines. Note in this mode, the server must be launched first.

So basically there are 3 ways to start the application. Feedback anyone?

Anyone knows what this means:

"All configuration must be done via a GUI, and must be persistent between runs of the program"
 
Ranch Hand
Posts: 783
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are on the right track, just make sure you are using the correct mode flags. It must only be "server", "alone", or left out completely. For instance, "java -jar runme.jar alone" will start the stand alone client, and "java -jar runme.jar" will start the networked client.

As far as the second part - "All configuration must be done via a GUI, and must be persistent between runs of the program" - I understand this to mean that any configuration such as selecting the location of the data file or specifying the host IP must be done from a GUI. That is, NOT from the command line. Also, if you are using RMI, you must start it from your program, not from the command line. Basically, the assessor should only need to type in the command listed above, and nothing else.

To make them persistent, you can save the information in the suncertify.properties file and load them when you start the application. That way the assessor doesn't have to do anything if the configuration has not changed.
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic