Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

server/alone command line

 
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm getting close to submission (in more ways than one!) and I'm having last minute panics (on just about everything!).
Now it says in the instructions


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.


Now up until today I had always read that as meaning that the server mode of the client gui must started by typing server, with the standalone client side gui started with alone with a default setting to server if not entered at all.
And that's what I did. Now I'm not so sure
My new reading of it is....
typing server starts the server application (ready to accept new remote clients)
typing alone starts the everthing in standalone mode
typing nothing starts the client in server mode which attempts to bind to
the specifed server.
I had previously assumed that Sun assumed that the person starting the server had some basic Java knowledge and could cope with more typing to start the server. But now I'm worried.
Thoughts?
Thanks,
Steve.
 
Ranch Hand
Posts: 619
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stephen,
Maybe this will help.
Your application can run in a networked or a non-networked mode. When you application is running in standalone mode it is running in the only non-networked mode. To run your application in standalone mode, you enter "java -jar runme.jar alone" at the command line.
When your application is running in networked mode things are a little more complicated. In networked mode you really have two instances of your application running at the same time in a client-server configuration.
One of these instances is running in server mode and it can be considered the server part of the client-server configuration. To run your application in server mode, you enter "java -jar runme.jar server" at the command line.
The other instance is running in network client mode and it can be considered the client part of the client-server configuration. To run your application in client mode, you enter "java -jar runme.jar" at the command line.
So, for any given instance of your application you will know it's operating mode from the command line argument from which it was started. There are only three cases:
1) STANDALONE MODE, java -jar rumme.jar alone: the only non-networked mode, requires no other instance of the application to be running.
2) SERVER MODE, java -jar runme.jar server: a networked mode, specifically the server part of the client-server configuration, requires no other instance of the application to be running (but will communicate with any applications running in network client mode that refer to this server).
3) NETWORK CLIENT MODE, java -jar runme.jar: a networked mode, specifically the client part of the client-server configuration, requires an instance of the application to be running in server mode (with which it will communicate if it is configured to refer to the server).
To state the obvious, when your application is running networked it means that you have one instance of your application running in server mode and at least one instance of your application running in network client mode. These applications can be on a single machine or on different machines, it really doesn't matter.
I think this comports with your most recent understaning of the requirement. I also think this is a correct understanding. If your application can run in these three operating modes and fulfill the requirements for operating in the given mode, then I think you're OK.
 
Stephen Galbraith
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for clearing that up for me.
It's all these "minor" misunderstandings of the spec that I'm trying to clear up and you've given me the confidence to implement the change!
Thanks
Steve.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a problem with this..
The specs states that:

Saying Each Part led me to believe that there should be more than one part(Jar).. and each part(Jar) must be Executable using the command line above.
But this conclusion conflicts with the rule of the command line argument (server vs alone vs nothing)..
Any body can explain this..
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Zafer,
Welcome to JavaRanch.
I would read this as "a part of your single executable jar file". So you only have one executable jar file, and you run different parts of it depending on what command line parameter (if any) is given.
Regards, Andrew
 
Zafer Abu saeed
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Andrew,
I think you are right.
Although I thought that packaging all interfaces, classes, and stubs (if RMI is used) for both sides (client and server) in a single Jar file will be a bad practice..
But it seems this is the requirement.

 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic