• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

RMI server IP/Port values

 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using RMI for connecting to the server. I am getting the IP/Port settings from the properties file whichj will be in the default directory. In case that file is missing what's the value of IP/Port we can use that won't cause any conflicts! Thanxs in advance.
 
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
localhost/1099
 
Ranch Hand
Posts: 38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I haven't coded this part. But here is what I plan to do in general. When my client starts, I display a connection selection dialog, where the user can choose to connect either locally or remotely. I default the selections and properties (db location, port, ip) to what the user chose last time by reading from the properties file. If the user wants to keep everything unchanged, he just click OK and move on. If the properties file doesn't exist or the values aren't there, the dialog defaults to local connection. But the user can change the settings. After the user enters the values, I persist them to the properties file and make the connection accordingly to start the main GUI.
 
Surya Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike

Using localhost as the IP: wont it cause the loopback!

Regards
 
mike acre
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Surya Kumar:
Mike

Using localhost as the IP: wont it cause the loopback!

Regards




Yes, but only in networked mode, if the examiner wants to test the requirement 'must not use network code' then they will run the standalone mode which should comply with that.
What default would you use for ip/host if not localhost, do you have a crystal ball handy?
 
Surya Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Mike

Ok from the server side we can use localhost. I have server port in the server side where the app is listening, and i have server location and server port in the client side. I can't hard code this in the properties file. For that reason the properties file has to be created the first time the application is run. During the first run the app asks for these three parameters using a UI and create the properties file. This is what i am planning to do. My questions is, Is this setup part necessary? Can't we supply the propertieds file with the jar file? Regards
 
mike acre
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can have a properties 'resource' within the runme.jar this can hold the defaults and populate an empty or existing suncertify.properties 'file'.
That way the suncertify.properties 'file' is not required for the app to run.
For the sake of this assignment, I strongly advise the defaults to be set to 1099, localhost & for the DB file - root directory and provided file name.
 
Surya Kumar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I thought that the db file is only in the working directory? Do you mean a user can point to a different file? Regards
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Surya Kumar:
I thought that the db file is only in the working directory? Do you mean a user can point to a different file? Regards



Yes. We must provide a way for the user to select location of db file. Individual requirements may vary. You might want to check your instructions to make sure.

Good Luck,
Satish.
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic