org.objectweb.jonas.common
Class NetUtils
java.lang.Object
org.objectweb.jonas.common.NetUtils
public class NetUtils
- extends Object
NetUtils
is meant to provide routine network related information to
components of JONAS. One of the main purposes is to allow the server to
extract it's own IP address correctly. This addresses a bug in java when
dealing with Linux boxes on DHCP trying to extract their own IP addresses and
always getting the loop back address instead of the external one.
- Author:
- Vivek Lakshmanan
Method Summary |
static String |
getLocalAddress()
Get the string form of the local IP address and not naively assume
InetAddress.getLocalHost().getHostAddress() is the
correct value. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOOP_BACK_ADDR
public static final String LOOP_BACK_ADDR
- IPv4 Loop back address.
- See Also:
- Constant Field Values
NetUtils
public NetUtils()
getLocalAddress
public static String getLocalAddress()
throws UnknownHostException
- Get the string form of the local IP address and not naively assume
InetAddress.getLocalHost().getHostAddress()
is the
correct value. See the class description above for details.
- Returns:
- A string representing the IPv4 localhost IP address.
- Throws:
UnknownHostException
Copyright © 2007 OW2 Consortium. All Rights Reserved.