|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.camel.util.InetAddressUtil
public final class InetAddressUtil
Util class for InetAddress
Method Summary | |
---|---|
static java.lang.String |
getLocalHostName()
When using the InetAddress.getHostName() method in an
environment where neither a proper DNS lookup nor an /etc/hosts
entry exists for a given host, the following exception will be thrown:
java.net.UnknownHostException: <hostname>: <hostname>
at java.net.InetAddress.getLocalHost(InetAddress.java:1425)
... |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String getLocalHostName() throws java.net.UnknownHostException
InetAddress.getHostName()
method in an
environment where neither a proper DNS lookup nor an /etc/hosts
entry exists for a given host, the following exception will be thrown:
java.net.UnknownHostException: <hostname>: <hostname>
at java.net.InetAddress.getLocalHost(InetAddress.java:1425)
...
Instead of just throwing an UnknownHostException and giving up, this
method grabs a suitable hostname from the exception and prevents the
exception from being thrown. If a suitable hostname cannot be acquired
from the exception, only then is the UnknownHostException thrown.
java.net.UnknownHostException
- is thrown if hostname could not be resolved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |