Limit RMI access to localhost

Hi all!Quick question: When I start up my RMI service it is accessible by all hosts on the network. Is there a way to limit this so only localhost can connect as a client?(And apart from blocking the port in localhost's firewall)Cheers,E
[280 byte] By [Esdna] at [2007-11-26 21:41:45]
# 1

There are two ways.

1. Run a SecurityManager in the server and only grant SocketPermission 'accept' to 'localhost'.

2. Code your remote objects' remote method implementations to check java.rmi.server.RemoteServer.getClientHost() and abort the method with a SecurityException (for example) or a java.rmi.AccessException if the client isn''t calling from localhost.

ejpa at 2007-7-10 3:27:29 > top of Java-index,Core,Core APIs...
# 2
Ok, I'll give it a try. Will probably go with the first suggestion.Thanks a lot,E
Esdna at 2007-7-10 3:27:29 > top of Java-index,Core,Core APIs...