Port questions with RMI
I'm getting confused about the RMI registry and the ports...
Here's the scenario:
I have a machine running a firewall. It blocks every ports by default unless I explicitly open them. I start rmiregistry using "rmiregistry 1099", just to be sure it is running on port 1099, so far so good.
I configured the firewall to open 1099 port and my clients can telnet to this box in port 1099 (using telnet myserver 1099).
Case 1:
If I publish a service into the registry, I have to use this constructor to specify that my service is running in this port 1100? (I cant use the 1099 port again because it is used). Do I need to open port 1100 in my firewall for my clients or is 1099 sufficient?
publicclass MyServiceImplextends UnicastRemoteObject{
public MyServiceImpl()throws RemoteException{
super(1100);
}
...
}
Case 2:
Suppose I do not run rmiregistry locally in the same JVM instead , and just use the default constructor,
publicclass MyServiceImplextends UnicastRemoteObject{
public MyServiceImpl()throws RemoteException{
super();
}
...
}
...
// Running rmi registry locally on same JVM
Registry registry = LocateRegistry.createRegistry( 1099 );
MyServiceImpl obj =new MyServiceImpl( );
...
Does it mean I only need port 1099 opened in my firewall for my clients? I'm running JDK 1.5.0_10 if that matters.
Thanks in advance,
Gary

