Package com.tangosol.net
Class CompositeAddressProvider.SingleProvider
java.lang.Object
com.tangosol.net.CompositeAddressProvider.SingleProvider
- All Implemented Interfaces:
AddressProvider,SocketAddressProvider
- Enclosing class:
- CompositeAddressProvider
AddressProvider wrapper for a single address dynamically added to this
AddressSet.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected InetSocketAddressThe single address that this AddressProvider represents.protected booleanIs this AddressProvider exhausted? -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()This method should be called by the client immediately after it determines that it can successfully use an address returned by theSocketAddressProvider.getNextAddress()method.booleanSocketAddressProvider instances are considered equivalent iff they consistently produce the same resulting set of addresses.Covariant ofSocketAddressProvider.getNextAddress()which returns anInetSocketAddress.inthashCode()Return the hash code for this SocketAddressProvider.voidThis method should be called by the client immediately after it determines that an attempt to use an address returned by theSocketAddressProvider.getNextAddress()method has failed.
-
Field Details
-
m_address
The single address that this AddressProvider represents. -
m_fExhausted
protected boolean m_fExhaustedIs this AddressProvider exhausted?
-
-
Constructor Details
-
SingleProvider
Constructor
-
-
Method Details
-
getNextAddress
Covariant ofSocketAddressProvider.getNextAddress()which returns anInetSocketAddress.- Specified by:
getNextAddressin interfaceAddressProvider- Specified by:
getNextAddressin interfaceSocketAddressProvider- Returns:
- the next available address or null if the list of available addresses was exhausted
-
accept
public void accept()This method should be called by the client immediately after it determines that it can successfully use an address returned by theSocketAddressProvider.getNextAddress()method.- Specified by:
acceptin interfaceSocketAddressProvider
-
reject
This method should be called by the client immediately after it determines that an attempt to use an address returned by theSocketAddressProvider.getNextAddress()method has failed.- Specified by:
rejectin interfaceSocketAddressProvider- Parameters:
eCause- (optional) an exception that carries the reason why the the caller rejected the previously returned address
-
equals
SocketAddressProvider instances are considered equivalent iff they consistently produce the same resulting set of addresses.Note: the general contract of hashCode and equals() should be preserved; AddressProviders that are "equal" should produce the same hashCode.
- Specified by:
equalsin interfaceSocketAddressProvider- Overrides:
equalsin classObject- Parameters:
o- the Object to compare this SocketAddressProvider to for equality- Returns:
- true iff this SocketAddressProvider is equal to the specified object
-
hashCode
public int hashCode()Return the hash code for this SocketAddressProvider.- Specified by:
hashCodein interfaceSocketAddressProvider- Overrides:
hashCodein classObject- Returns:
- the hash code for this SocketAddressProvider
-