How to find out whether a RMI calling client is local or non-local

How to find out whether a RMI calling client is on the same physical machine as the server.Taken into account the machine may have multiple NIC and hence multiple possible IPs.Regards
[204 byte] By [eddiecjchianga] at [2007-11-27 9:07:26]
# 1
1. enumerate the ip addresses for the computer.2. See if the IP of the RMI caller is one of those.
bschauwejavaa at 2007-7-12 21:44:09 > top of Java-index,Core,Core APIs...
# 2

Yep. Call java.rmi.RemoteServer.getClientHost(). If it doesn't throw an exception, you are in an RMI thread and you can check the returned hostname to see whether it is local. If it does throw an exception, you are being called locally from within the same JVM via direct (local) method invocation.

ejpa at 2007-7-12 21:44:09 > top of Java-index,Core,Core APIs...