I want to use a simple JINI architecture where JINI services (rmid, reggie, mahalo) and a JavaSpace (outrigger) run on a designated machine (javaspace), and clients from another network (scs, physically near) can connect to the JINI services on javaspace.
Because of the two different networks involved, a firewall is set up to limit traffic generated from scs to the outside, and another, on the javaspace machine, to protect it from the outside.
The default firewall policy is to open only the necessary ports (in or/and out). This does not help JINI at all, since it seems that on the javaspace machine, each time I start a service, several server sockets listen on randomly generated ports.
I thought the problem resided in a couple of
new ServerSocket(0)
lines in different source files of the JINI distribution, and I took the liberty to change those into calls which would attempt to open ports only in a controlled range (4500 - 4600). Although it seems that two of the servers really obeyed and used ports in the limited range, there are still other open sockets on the javaspace machine, to which clients running on machines in the scs network try to connect, listening to strange ports (like 55525).
Can anyone tell me how to tame a little the JINI machinery and make it more firewall friendly? This problem, means, indeed, that using JINI for Web Services is out of the question - nobody disables security just because random ports are used by some servers...