• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Command Line Argument - Mode Flag

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I'm bit confused with this statement. "

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.

"

Am I right on these?
1. We will be using same runme.jar to launch the application for three different mode(way) like one as server alone, and another as client alone and another one as client-cum-server (means process will do all the jobs)?

2. Just to check; when we pass,
a) "server" -> Only network server program should run - we have to launch client program separately using same runme.jar by not specifying anything in the mode flag; just by leaving it blank (either from different or same machine).

b) "alone" -> this type of launch will do both server side jobs as well as clients side jobs (means directly accessing DB file)

c) left blank -> Only network client program should run (i.e., GUI alone). Server must be started separately.

Thanks in advance,
Seetha...
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No need to be confused, your remarks are spot-on

the same jar (runme.jar) is used to run the application in 3 different modes (depending on a single argument):
  • "server": starts the network server
  • "alone": starts the stand alone client application
  • (no argument): starts the network client application (which has to access the network server to make changes to the database file)
  •  
    Seetharaman Iyer
    Ranch Hand
    Posts: 35
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Thank you so much Roel for your timely help. You are a champ
     
    Ranch Hand
    Posts: 147
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Follow up question: How to handle the situation where this is a first execution of the program (which means no properties file yet exists) and no argument is passed. If both the server and client apps are to startup (the client being in network mode), should we force the server to come up first before allowing the user to make use of the client gui?
     
    Seetharaman Iyer
    Ranch Hand
    Posts: 35
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Follow up question: How to handle the situation where this is a first execution of the program (which means no properties file yet exists) and no argument is passed. If both the server and client apps are to startup (the client being in network mode), should we force the server to come up first before allowing the user to make use of the client gui?


    It's not necessary. It's all upto us how we want the things to be working. In my case, no matters server is already started or not, client (networked) can be launched and run. I allow the user to change the server's ipaddress and port details while it's running. So the only time when the user wants to search (& Reserve) only, I need to connect to the server to get (reserve) the details. Rest of the time, it just can simply run. No matters whether server got crashed. This option also enable the user to connect to the different server (by specifying ipaddress and port).
     
    Roel De Nijs
    Sheriff
    Posts: 11604
    178
    Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Ed Ward wrote:If both the server and client apps are to startup (the client being in network mode), should we force the server to come up first before allowing the user to make use of the client gui?


    How are you planning to force the startup of a jar on any random computer (ip unknown to you) in the company network?

    Your network client just starts, dialog shows, user enters configuration settings (ip + port) and if no server application is found a message wille be shown: "server not running"
     
    machines help you to do more, but experience less. Experience this tiny ad:
    Thread Boost feature
    https://coderanch.com/t/674455/Thread-Boost-feature
    reply
      Bookmark Topic Watch Topic
    • New Topic