wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Shoud I persist the RMI registry and server ports? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Shoud I persist the RMI registry and server ports?" Watch "Shoud I persist the RMI registry and server ports?" New topic
Author

Shoud I persist the RMI registry and server ports?

Mattew Force
Greenhorn

Joined: May 03, 2007
Posts: 16
Hi all,

I'm done with most of the coding on the B&S project now, but I have some questions.

First, should the users be able to specify on which ports the RMI registry and server should run on, e.g.



Once the client does a lookup on the service it doesn't need to provide a port to the server, only to the remote registry, e.g.



So there is no need to ask the client for the server port, but only the host and registry port if we allow it to be other than the default 1099. It would nonetheless be good to let the server run on a user-specified port if the server runs behind a firewall.

I guess it would also be good to allow changing the name of the RMI service in both the client and server mode. This way we can connect to different services and we would also avoid RMI service name conflicts.

Thoughts on this?

Regards,

Mattew
[ August 21, 2007: Message edited by: Mattew Force ]
Gabriel Vargas
Ranch Hand

Joined: May 16, 2007
Posts: 145
Hi Mattew,


So there is no need to ask the client for the server port, but only the host and registry port if we allow it to be other than the default 1099. It would nonetheless be good to let the server run on a user-specified port if the server runs behind a firewall.


I think you could store both the host and the server port and if you like the name of the service, normally i see than people stores host and server port and name service is fixed (I do this), i do that becuase specification tell me than it is only one server at one time so i be worried only to ask where is the server and what port are avaible (i think ask name service to client is a bit confuse for him) but maybe with good arguments you can do in your way. I'm not worried about firewall because this is out of scope of the application, this is configuration of the machines.

I hope it helps you.


Gabriel Vargas
SCJP, SCJD, now studying for SCWCD and working to be a better person
Mattew Force
Greenhorn

Joined: May 03, 2007
Posts: 16
Originally posted by Gabriel Vargas:
Hi Mattew,



I think you could store both the host and the server port and if you like the name of the service, normally i see than people stores host and server port and name service is fixed (I do this), i do that becuase specification tell me than it is only one server at one time so i be worried only to ask where is the server and what port are avaible (i think ask name service to client is a bit confuse for him) but maybe with good arguments you can do in your way. I'm not worried about firewall because this is out of scope of the application, this is configuration of the machines.

I hope it helps you.



Hi Gabriel,

Thanks for your reply.

Do you ask the client users for the RMI service port? I don't see the need to ask client users for the server port which is specified when you call UnicastRemoteObject.exportObject(remoteService, serverPort) because the RMI registry will find the server regardless of what port it has, the clients only need to get the servers RMI registry but this is run on another port, default is 1099.

Regards,

Mattew
Gabriel Vargas
Ranch Hand

Joined: May 16, 2007
Posts: 145
Hi Mattew,

I develop my network server to ask for database location and port to start RMI registry if the default port 1099 is busy, so client need ask for host and port if the port is changed in server, i think this is not complicated and add a good functionality for a newtworked enviroment to be flexible in which port application can connect(i also put default port in 1099 in both remote server and remote client if there aren't a default properties file and stores last configuration than has worked).

The paragraph


when you call UnicastRemoteObject.exportObject(remoteService, serverPort) because the RMI registry will find the server regardless of what port it has


I don't think is true, in java.rmi.Naming documentation tells about the port on which the registry accept calls and if it isn't specified the default port used is 1099.


I hope it helps you.
 
Don't get me started about those stupid light bulbs.
 
subject: Shoud I persist the RMI registry and server ports?