1) "server program must run" means "Start RMI Server" or "Switch to Network Mode"?
2) "network client and gui must run" means "Switch to Network Mode and open the UI"?
3)Should I add to UI a network/local switcher?
SCJP 1.2, OCP 9i DBA, SCWCD 1.3, SCJP 1.4 (SAI), SCJD 1.4, SCWCD 1.4 (Beta), ICED (IBM 287, IBM 484, IBM 486), SCMAD 1.0 (Beta), SCBCD 1.3, ICSD (IBM 288), ICDBA (IBM 700, IBM 701), SCDJWS, ICSD (IBM 348), OCP 10g DBA (Beta), SCJP 5.0 (Beta), SCJA 1.0 (Beta), MCP(70-270), SCBCD 5.0 (Beta), SCJP 6.0, SCEA for JEE5 (in progress)
[url]Olnex.net[/url]
[SCJP 1.2, SCJD, SCWCD]
Regards, George
SCJP, SCJD, SCWCD, SCBCD
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Originally posted by Andrew Monkhouse:
Hi Leo,
Welcome to JavaRanch.
Perhaps this might help:
So, if the user types
- java -jar runme.jar -server
Dispay the GUI for the Server (allow the user to enter port for RMI Registry, possibly enter local db path for the server, any other server configuration items).
- java -jar runme.jar -alone
Display the Client GUI ready to ask local db path
- java -jar runme.jar
Display the Client GUI and ask for the host + port for RMI connection
Regards, Andrew
Originally posted by Satish Avadhanam:
You said above that we are supposed to display the client GUI and ask for host + port for RMI connection. What I don't understand is the requirements say that network client and gui must run. From your statement, I understood that the gui is Clinet GUI, but what about the network client? Are we asking host + port for RMI connection for this sake only?
Please clarify me with the understanding of "network client".
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Vrinda Werdel:
For this (# 3) to successfully execute, the Server part should already be running right? That is the remote interface should be registered with the RMI registry?
BTW, who will start the registry?
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Vrinda Werdel:
Hi George,
This is a very informative discussion. I have one more question.
1 .when we run 'java -jar runme.jar -server'
Is it safe to say the only the server part is up (starting the RMI reg. binding to RMI registry) and ready to listen to incoming connections?
If this mode is selected and run, a GUI is shown. In this GUI all we can do is to configure the Server and exit right? I mean we cannot do any business specific operations right. The one and only purpose of this GUI or to say mode is to "Configure the Server, like port, host". Am I right?
2. When we run ' java -jar runme.jar -alone'
Both the GUI and the Server part of the application run in the same JVM? Pl. correct me if I am wrong.
In this mode, a GUI will be shown. In the first screen of the GUI, we select the database file location on the local machine. The second screen will show all the business we can do, like book a hotel, search the hotels and other business specific functions, right?
3. when we run ' java -jar runme.jar' it effectively starts a GUI which has its own JVM and connects to another process runinng in a different VM across the network?
For this (# 3) to successfully execute, the Server part should already be running right? That is the remote interface should be registered with the RMI registry?
In this mode, a GUI will be shown. In the first screen of the GUI, we have to give the server port, host and other configurations required for remote client. In the second screen, we can do all business specific activities, same as what we can do in the second screen of the alone mode, right?
BTW, who will start the registry?
In the last mode, once we select the remote server host and port numbers, it should automatically start the server and start listening right? I mean we need to hard code this part so that once this mode is selected the server starts automatically? Is this correct?
Regards
Vrinda
1 .when we run 'java -jar runme.jar -server'
Is it safe to say the only the server part is up (starting the RMI reg. binding to RMI registry) and ready to listen to incoming connections?
If this mode is selected and run, a GUI is shown. In this GUI all we can do is to configure the Server and exit right? I mean we cannot do any business specific operations right. The one and only purpose of this GUI or to say mode is to "Configure the Server, like port, host". Am I right?
Yes. Yes. The GUI can also allow the user to shutdown the server.
2. When we run ' java -jar runme.jar -alone'
Both the GUI and the Server part of the application run in the same JVM? Pl. correct me if I am wrong.
In this mode, a GUI will be shown. In the first screen of the GUI, we select the database file location on the local machine. The second screen will show all the business we can do, like book a hotel, search the hotels and other business specific functions, right?
That's the right idea. Here are some more things to consider. Does the user always have to see the first screen? If you are using the suncertify.properties file to persist the user's selections, do you always have to show the user the first screen? Maybe the first screen only needs to be shown if there isn't a suncertify.properties file or if the entries in the suncertify.properties file are wrong (that is, they cause some sort of problem when they're used).
3. when we run ' java -jar runme.jar' it effectively starts a GUI which has its own JVM and connects to another process runinng in a different VM across the network?
For this (# 3) to successfully execute, the Server part should already be running right? That is the remote interface should be registered with the RMI registry?
In this mode, a GUI will be shown. In the first screen of the GUI, we have to give the server port, host and other configurations required for remote client. In the second screen, we can do all business specific activities, same as what we can do in the second screen of the alone mode, right?
Absolutely, the second screen in this mode is exactly the same as the second screen in alone mode (well, maybe one screen title says something about remote mode and the other says something about local mode, but other than that they're the same.) I have the same comment about the first screen as in the previous question.
BTW, who will start the registry?
In the last mode, once we select the remote server host and port numbers, it should automatically start the server and start listening right? I mean we need to hard code this part so that once this mode is selected the server starts automatically? Is this correct?
No, the server does not start automatically when the client runs. The application (in server mode) must be started on the server before the application (in remote client mode) is started on the client machine. Starting a client-server application is a two step process. First you start the server. Then you start the client. So, my answer to your last question about starting the server automatically is no.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Rolf Johansson:
A point of clarification...presently I have Java applications. That is, 3 Java applications, each with their own main method.
Your life will be much easier with a single application.
1) A Java application is my server that instantiates my database class and listens on a socket port for incoming requests from clients. As a request comes in this application performs the database activity and returns the results over the socket to the client
This will be a problem unless you can call this application as follows:
java -jar runme.jar server
That is, this application should be your runme.jar operating in server mode.
2) A Java application that puts up the GUI for the user to use. This application takes the famous <mode> command line argument. If <mode> is absent, this program connects to the server (1) and sends requests to the server over a socket, and get responses back from the server. If <mode> is "alone" it instantiates my database class and performs database activity directly, based on GUI activity.
This is fine, as long as this application is called runme.jar.
3) A small Java application with a GUI that is used to update suncertify.properties file.
You shouldn't have a separate application (that is, some application other than runme.jar). Such a capability, which is required, should be integrated into your single application.
What I am confused about is the term "programs" in the instructions:
"The executable JAR containing the programs. This must be called runme.jar."
An executable jar (AFAIK) can only have 1 Java application. So what do they mean by "programs"? Am I supposed to have just 1 Java application that acts as a (1)server, (2)standalone clinet and (3)remote client? Should I just merge my applications from above (1 and 2) into 1 application that read the command line argument and behaves accordingly?
Then how do I get the examiners to run my program that manages the suncertify.properties file?
The use of the word "programs" in the assignment instructions is very unfortunate. The word should not be plural. They might possibly be referring to individual *.class files as programs, but that is a very eccentric and misleading way to refer to *.class files, in my opinion. Assume for a moment that "programs" is replaced by "program", and the assignment instructions become much clearer and easier to understand. I would argue that having a single program is not inconsistent with the instructions (and in fact, is the only interpretation that makes sense). An executable jar can only have one program. So, 1, 2, and 3 should be merged into a single executable (called runme.jar). Then, you don't need to get the examiner to run your suncertify.properties file editor, because it's built into your single application.
Regards, George
SCJP, SCJD, SCWCD, SCBCD
Originally posted by Rolf Johansson:
Now if my properties manager is also included in the 1 Java application how do I know to run it, if the only possible command line arguments are as specified above?
Regards, George
SCJP, SCJD, SCWCD, SCBCD
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |