protected class CompositeAddressProvider.SingleProvider extends Object implements AddressProvider
Modifier and Type | Field and Description |
---|---|
protected InetSocketAddress |
m_address
The single address that this AddressProvider represents.
|
protected boolean |
m_fExhausted
Is this AddressProvider exhausted?
|
Modifier | Constructor and Description |
---|---|
protected |
SingleProvider(InetSocketAddress address)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
accept()
This method should be called by the client immediately after it determines that it can successfully use an address returned by the
SocketAddressProvider.getNextAddress() method. |
boolean |
equals(Object o)
SocketAddressProvider instances are considered equivalent iff they consistently produce the same resulting set of addresses.
|
InetSocketAddress |
getNextAddress()
Covariant of
SocketAddressProvider.getNextAddress() which returns an InetSocketAddress . |
int |
hashCode()
Return the hash code for this SocketAddressProvider.
|
void |
reject(Throwable eCause)
This method should be called by the client immediately after it determines that an attempt to use an address returned by the
SocketAddressProvider.getNextAddress() method has failed. |
protected InetSocketAddress m_address
protected boolean m_fExhausted
protected SingleProvider(InetSocketAddress address)
public InetSocketAddress getNextAddress()
SocketAddressProvider.getNextAddress()
which returns an InetSocketAddress
.getNextAddress
in interface AddressProvider
getNextAddress
in interface SocketAddressProvider
public void accept()
SocketAddressProvider.getNextAddress()
method.accept
in interface SocketAddressProvider
public void reject(Throwable eCause)
SocketAddressProvider.getNextAddress()
method has failed.reject
in interface SocketAddressProvider
eCause
- (optional) an exception that carries the reason why the the caller rejected the previously returned addresspublic boolean equals(Object o)
Note: the general contract of hashCode and equals() should be preserved; AddressProviders that are "equal" should produce the same hashCode.
equals
in interface SocketAddressProvider
equals
in class Object
o
- the Object to compare this SocketAddressProvider to for equalitypublic int hashCode()
hashCode
in interface SocketAddressProvider
hashCode
in class Object