|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
com.tangosol.net.ConfigurableAddressProvider
public class ConfigurableAddressProvider
ConfigurableAddressProvider is an implementation of the AddressProvider interface based on a static list of addresses configured in an XML element that contains one or more items in the following format:
<socket-address> <address>...</address> <port>...</port> </socket-address> ... <address>...</address>
The order of items in the configured list will be randomized to provide basic load balancing.
This implementation is not thread safe.
| Nested Class Summary | |
|---|---|
static class |
ConfigurableAddressProvider.AddressHolderA stateful holder for an obtaining an InetSocketAddress object. |
| Field Summary | |
|---|---|
boolean |
m_fResolveDeprecated. |
protected boolean |
m_fSafeSpecifies if the provider is only to return resolved addresses. |
protected int |
m_iLastIndex of the last returned address. |
protected java.util.List |
m_listHoldersA list of ProvidedAddress objects. |
| Constructor Summary | |
|---|---|
ConfigurableAddressProvider(java.lang.Iterable addressHolders, boolean fSafe)Constructs a ConfigurableAddressProvider using the specified ConfigurableAddressProvider.AddressHolders. |
|
ConfigurableAddressProvider(XmlElement xmlConfig)Deprecated. |
|
ConfigurableAddressProvider(XmlElement xmlConfig, boolean fSafe)Deprecated. |
|
| Method Summary | |
|---|---|
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. |
protected void |
configure(XmlElement xmlConfig)Deprecated. |
boolean |
equals(java.lang.Object o)AddressProvider instances should compare to be equals() iff they should be expected to consistently produce the same resulting set of addresses. |
java.lang.String[] |
getAddressDescriptions()Retrieve a human readable description of underlying addresses. |
java.net.InetSocketAddress |
getNextAddress()Covariant of SocketAddressProvider.getNextAddress() which returns an InetSocketAddress. |
int |
hashCode()Return the hash code for this AddressProvider. |
java.util.Iterator |
iterator()Returns an iterator over the elements contained in this collection. |
static AddressProvider |
makeProvider(XmlElement xmlConfig)Deprecated. |
void |
reject(java.lang.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 void |
reset()Make all addresses iterable, starting at the first address. |
protected void |
reset(int iLast)Make all addresses iterable, starting at the index after the specified one. |
protected java.net.InetSocketAddress |
resolveAddress(java.lang.String sHost, int nPort)Resolve an address and port. |
int |
size()Returns the number of elements in this collection. |
protected java.util.List |
sortHolders(java.util.List list)Sort the holders in the order to be returned by the getNextAddress() method. |
java.lang.String |
toString()Return a string representation of this ConfigurableAddressProvider. |
| Methods inherited from class java.util.AbstractSet |
|---|
removeAll |
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray |
| Methods inherited from interface java.util.Set |
|---|
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray |
| Field Detail |
|---|
protected java.util.List m_listHolders
protected int m_iLast
protected boolean m_fSafe
@Deprecated
public boolean m_fResolve
| Constructor Detail |
|---|
@Deprecated
public ConfigurableAddressProvider(XmlElement xmlConfig)
Unresolvable addresses will be skipped.
xmlConfig - the XML element that contains the configuration info
public ConfigurableAddressProvider(java.lang.Iterable addressHolders,
boolean fSafe)
ConfigurableAddressProvider using the specified ConfigurableAddressProvider.AddressHolders.
addressHolders - the ConfigurableAddressProvider.AddressHoldersfSafe - true if the provider skips unresolved addresses
@Deprecated
public ConfigurableAddressProvider(XmlElement xmlConfig,
boolean fSafe)
xmlConfig - the XML element that contains the configuration infofSafe - true if the provider skips unresolved addresses| Method Detail |
|---|
@Deprecated
public static AddressProvider makeProvider(XmlElement xmlConfig)
xmlConfig - the XML element that contains the configuration infopublic java.net.InetSocketAddress getNextAddress()
SocketAddressProvider.getNextAddress() which returns an InetSocketAddress.getNextAddress in interface AddressProvidergetNextAddress in interface SocketAddressProviderpublic void accept()
SocketAddressProvider.getNextAddress() method.accept in interface SocketAddressProviderpublic void reject(java.lang.Throwable eCause)
SocketAddressProvider.getNextAddress() method has failed.reject in interface SocketAddressProvidereCause - (optional) an exception that carries the reason why the the caller rejected the previously returned addresspublic int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.AbstractCollectionpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.AbstractCollectionprotected void reset()
protected void reset(int iLast)
iLast - the index of the last address returned
@Deprecated
protected void configure(XmlElement xmlConfig)
xmlConfig - the XML element that contains the configuration infoprotected java.util.List sortHolders(java.util.List list)
getNextAddress() method. This implementation randomizes the holder list for simple load balancing.list - the original list retrieved from the configurationpublic boolean equals(java.lang.Object o)
Note: the general contract of hashCode and equals() should be preserved; AddressProviders which compare equals() should have the same hashCode.
equals in interface SocketAddressProviderequals in interface java.util.Collectionequals in interface java.util.Setequals in class java.util.AbstractSeto - the Object to compare this AddressProvider to for equalitypublic int hashCode()
hashCode in interface SocketAddressProviderhashCode in interface java.util.CollectionhashCode in interface java.util.SethashCode in class java.util.AbstractSetpublic java.lang.String toString()
toString in class java.util.AbstractCollectionpublic java.lang.String[] getAddressDescriptions()
getAddressDescriptions in interface DescribableAddressProvider
protected java.net.InetSocketAddress resolveAddress(java.lang.String sHost,
int nPort)
sHost - the hostnPort - the port
|
Oracle® Fusion Middleware Java API Reference for Oracle Coherence 12c (12.1.3.0.0) E47890-01 |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||