aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes suncertify.properties question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "suncertify.properties question" Watch "suncertify.properties question" New topic
Author

suncertify.properties question

b weiss
Greenhorn

Joined: Apr 14, 2009
Posts: 7
Hey!

I just had a quick question. In the Deliverables section of my assignement it states this:

java -jar <path and_filename> [<mode>] Your programs must not require the use of comman line arguments other than the single mode flag, which must be supported. Your programs must not require use of a command line property specifications. All configuration must be done via a GUI, and must be persistent between runs of the program. Such configuration information must be stored in a file called suncertify.properties which must be located in the current working directory. The mode flag must be either "server", indivating the server program must run, "alone" indicating standalone mode, or left out entirely, in which case the network client and gui must run.


The part that says
All configuration must be done via a GUI
does this mean that when the person grading the application runs the jar file a GUI should come up with the information already specified in the suncertify.properties file allowing them to change the information if necessary? Or that there should a GUI that can be accessed through the client to change these properties?

Also, would I be correct in assuming that the only information needed in the suncertify.properties file would be the location of the database and the port on which the database will listen?
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2247

Howdy, B!

...does this mean that when the person grading the application runs the jar file a GUI should come up with the information already specified in the suncertify.properties file allowing them to change the information if necessary?


Yup. When the application starts, a GUI should be displayed, with the information according to the way the application was started. For instance, when the application starts in server mode, a small dialog should be displayed, asking for the database location and other things you may judge necessary. If a suncertify.properties file still does not exist in the current working directory (System.getProperty("user.dir")), then it should be created there. If it already exists, then the dialog should be populated with its content. You have to allow the application to start in 3 modes: server, where you just start it and wait for clients to connect to it; client, where a server should already be running, so you can connect to it; and standalone mode, where the server code is not executed, and the database is accessed directly. For these 3 modes, you display the dialog with the proper information. In my case, when the app starts in server mode, it asks for the database location and server port in which the server will run. When the app starts in standalone mode, it just asks for the database location. And when the app starts in client mode, it asks for the server's IP address and the port number where the service is running on the server.


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
Pieter Jacobs
Ranch Hand

Joined: May 20, 2009
Posts: 87
Hi Roberto,

I do agree with your sentence:
You have to allow the application to start in 3 modes: server, where you just start it and wait for clients to connect to it; client, where a server should already be running, so you can connect to it; and standalone mode, where the server code is not executed, and the database is accessed directly.

but, in the assignment file it says:
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.

I think they mean that if we use "server", then the server will startup. If we use "alone" then it is in standalone mode, and if we omit the arguments, it will startup the gui expecting the server is already running ? (your throughts)

Thanks,
Pieter
Anne Crace
Ranch Hand

Joined: Aug 29, 2005
Posts: 223
Pieter,
You are correct about the server mode and the alone mode, but for the network client mode ( the one that takes no arguments), they client needs to input the port number the server is listening on and the server's IP address. If they input the correct information, ( and you wrote your remote interface correctly) then the main application with the table is displayed. I did mine very much like Andrew's book, with dialogs for the setup interfaces. You should take a look at that book if you haven't done so already.


SCJP, SCJD
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2247

Howdy, Pieter!

I think they mean that if we use "server", then the server will startup. If we use "alone" then it is in standalone mode, and if we omit the arguments, it will startup the gui expecting the server is already running ? (your throughts)


Agreed!
Pieter Jacobs
Ranch Hand

Joined: May 20, 2009
Posts: 87
Hi Anne & Roberto,

Thanks for the feedback!

Anne, which book are you referring to by Andrew? I am busy working through "Complete Java 2 Certification Study Guide" (Phil Heller & Simon Roberts) and "Head First Design Patterns" (Freeman & Freeman), and they're both awesome. I would love to check out the book you're talking about though.

Thanks and have a great week!
Pieter
Anne Crace
Ranch Hand

Joined: Aug 29, 2005
Posts: 223
The book is SCJD Exam with J2SE 5 (2nd edition) by Andrew Monkhouse and Terry Camerlango. If you find one of Andrew's posts, and it shouldn't be too hard as he's a moderator on this forum, he has a link to both the e-book and the hard copy in his signature.
Pieter Jacobs
Ranch Hand

Joined: May 20, 2009
Posts: 87
Hi Anne,

Thanks !! I'll search quickly.

Have fun,
Pieter
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: suncertify.properties question
 
Similar Threads
NX:RMI-How to keep the RMI factory service running always?
NX: Configuring port number
execution and executable Jar question for SCJD
suncertify. properties -- Network / non-networked mode
NX:How to jar my assignment?