• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

B&S Configuration?. Help me understand it.

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello people,
This question has been asked many many times. Still some things are not clear to me by reading
the related threads.

Here are my questions

1) can i create a package suncertify.config. In that package i want to create a java class Called Configuration which is the entry point to my application



In the Configuration class, I have a main() method constructs a dialog for configuration based on the type of argument.


2)

java -jar <path_and_filename> Server

pops up a dialog that requires the following user input.

Server name: Is this really required? or can we get the Ip address using InetAddress.getLocalHost().getHostAddress()?.

Dblocation: This is required for the server to establish the communication with the database right?.

server Port: Is this required too? Or can we default it to 1099?

database port: Do we need it?



java -jar <path_and_filename> Alone

pops up the dialog that requires the folloing input from user

Dblocation: Needed as the client estabishes the connection with out the network code right?.

database Port: Do we need it?



java -jar <path_and_filename>

This is where i am more confused.

For this step to occur, Does the server has to be already up and running on different machine or same machine?

pops up the dialog that requires the folloing input from user

server name: ip address right?. Does it matter if the user enters the url?.

server port: do we need the port or just default 1099?.


Your input is appreciated.
[ April 24, 2008: Message edited by: John Mattman ]
 
John Mattman
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did some research myself and came up with this.




1) java -jar <path_and_filename> Server

read the properties file. If there is a reference about the server, present the server info for user confirmation. other wise present the gui that requires the following 3 options


i) Data base location

ii) database port( Don't know if i require this)

iii) server port


The app can get the IP address with this command "InetAddress.getLocalHost().getAddress()".


validate and persist the data to the properties file.



2) java -jar <path_and_filename> no argument


scenario 1)
Read the properties file. see if there is a reference about the
server. if there is reference then the server was run locally.
Read the ip address and port number of the server from the
properties file and start/(connect to) the server and present the
app gui.



scenario 2)

read the properties file. if there is no reference about the
server info. This means the server is running remotely or
locally(if the server is run in different folder) and the user is
presented with gui that requires the following info.


i) server name(ip address/url)

ii) port number( if the gui does not receive a port number, the
application will pass 1099(default))



validate and persist the data to the properties file.




3) java -jar <path_and_filename> Alone

pretty straight forward. read the properties file and present it in the
gui or present the gui that requires the following fields

i) database location

ii) port(don't know if we need a port number?)


validate and persist the data to the properties file.
[ April 24, 2008: Message edited by: John Mattman ]
reply
    Bookmark Topic Watch Topic
  • New Topic