Class LoopbackAddressInterfaceCriteria
- java.lang.Object
-
- org.jboss.as.controller.interfaces.AbstractInterfaceCriteria
-
- org.jboss.as.controller.interfaces.LoopbackAddressInterfaceCriteria
-
- All Implemented Interfaces:
Serializable
,Comparable<InterfaceCriteria>
,InterfaceCriteria
public class LoopbackAddressInterfaceCriteria extends AbstractInterfaceCriteria
A loopback criteria with a specified bind address.- Version:
- $Revision:$
- Author:
- Scott stark ([email protected]) (C) 2011 Red Hat Inc.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LoopbackAddressInterfaceCriteria(String address)
Creates a new LoopbackAddressInterfaceCriteriaLoopbackAddressInterfaceCriteria(InetAddress address)
Creates a new LoopbackAddressInterfaceCriteria
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
InetAddress
getAddress()
int
hashCode()
protected InetAddress
isAcceptable(NetworkInterface networkInterface, InetAddress address)
Gets whether the given network interface and address are acceptable for use.String
toString()
-
Methods inherited from class org.jboss.as.controller.interfaces.AbstractInterfaceCriteria
cloneCandidates, compareTo, getAcceptableAddresses
-
-
-
-
Constructor Detail
-
LoopbackAddressInterfaceCriteria
public LoopbackAddressInterfaceCriteria(InetAddress address)
Creates a new LoopbackAddressInterfaceCriteria- Parameters:
address
- a valid value to pass toInetAddress.getByName(String)
Cannot benull
- Throws:
IllegalArgumentException
- ifnetwork
isnull
-
LoopbackAddressInterfaceCriteria
public LoopbackAddressInterfaceCriteria(String address)
Creates a new LoopbackAddressInterfaceCriteria- Parameters:
address
- a valid value to pass toInetAddress.getByName(String)
Cannot benull
- Throws:
IllegalArgumentException
- ifnetwork
isnull
-
-
Method Detail
-
getAddress
public InetAddress getAddress() throws UnknownHostException
- Throws:
UnknownHostException
-
isAcceptable
protected InetAddress isAcceptable(NetworkInterface networkInterface, InetAddress address) throws SocketException
Gets whether the given network interface and address are acceptable for use. Acceptance is indicated by returning the address which should be used for binding against the network interface; typically this is the givenaddress
parameter. For those criteria which override the configured address, the override address should be returned.- Specified by:
isAcceptable
in classAbstractInterfaceCriteria
- Parameters:
networkInterface
- the network interface. Cannot benull
address
- an address that is associated withnetworkInterface
. Cannot benull
- Returns:
ifgetAddress()
()NetworkInterface.isLoopback()
is true, null otherwise.- Throws:
SocketException
- if evaluating the state ofnetworkInterface
results in one
-
-