|
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
com.tangosol.net.CompositeAddressProvider
public class CompositeAddressProvider
CompositeAddressProvider is a composite of one or more AddressProviders or addresses that also implements the Set interface. This AddressProvider will provide addresses from all registered AddressProviders or Addresses.
This class implements the Set interface, but the contents are not checked to determine whether each element is unique. It is the responsibility of the user to ensure that the elements are unique if the object is used as a Set.
This implementation is thread-safe for consumers of the Set interface, but allows no more than one consumer of the AddressProvider interface.
| Nested Class Summary | |
|---|---|
protected static class |
CompositeAddressProvider.AddressIteratorAn Iterator over the addresses in this AddressProvider. |
protected class |
CompositeAddressProvider.SingleProviderAddressProvider wrapper for a single address dynamically added to this AddressSet. |
| Field Summary | |
|---|---|
protected CompositeAddressProvider.AddressIterator |
m_iterInternalThe default iterator used to implement the AddressProvider interface. |
| Constructor Summary | |
|---|---|
CompositeAddressProvider()Default constructor. |
|
CompositeAddressProvider(AddressProvider provider)Construct a CompositeAddressProvider from the specified AddressProvider. |
|
| 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. |
boolean |
add(java.lang.Object o)Ensures that this collection contains the specified element (optional operation). |
void |
addAddress(java.net.InetSocketAddress address)Add an address. |
void |
addProvider(AddressProvider provider)Add an AddressProvider. |
protected CompositeAddressProvider.AddressIterator |
ensureInternalIterator()Create (if necessary) and return the default iterator. |
boolean |
equals(java.lang.Object o)SocketAddressProvider instances are considered equivalent iff they consistently produce the same resulting set of addresses. |
java.lang.String[] |
getAddressDescriptions()Retrieve a human readable description of underlying addresses. |
protected java.util.List |
getConfiguredAddresses(AddressProvider provider)Return a list of configured addresses in the specified AddressProvider. |
java.net.InetSocketAddress |
getNextAddress()Covariant of SocketAddressProvider.getNextAddress() which returns an InetSocketAddress. |
protected java.util.List |
getProviderList()Return the provider list. |
int |
hashCode()Return the hash code for this AddressProvider. |
java.util.Iterator |
iterator()Returns an iterator over the elements contained in this collection. |
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. |
boolean |
remove(java.lang.Object o)Removes the specified element from this set if it is present (optional operation). |
int |
size()Returns the number of elements in this collection. |
| Methods inherited from class java.util.AbstractCollection |
|---|
addAll, clear, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray, toString |
| Methods inherited from interface java.util.Set |
|---|
addAll, clear, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray |
| Field Detail |
|---|
protected CompositeAddressProvider.AddressIterator m_iterInternal
| Constructor Detail |
|---|
public CompositeAddressProvider()
public CompositeAddressProvider(AddressProvider provider)
provider - the AddressProvider to add| Method Detail |
|---|
public void addProvider(AddressProvider provider)
provider - the AddressProvider to addpublic void addAddress(java.net.InetSocketAddress address)
address - the address to addprotected java.util.List getProviderList()
public 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 java.lang.String[] getAddressDescriptions()
getAddressDescriptions in interface DescribableAddressProviderpublic boolean equals(java.lang.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 SocketAddressProviderequals in interface java.util.Collectionequals in interface java.util.Seto - the Object to compare this SocketAddressProvider to for equalitypublic int hashCode()
hashCode in interface SocketAddressProviderhashCode in interface java.util.CollectionhashCode in interface java.util.Setpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class java.util.AbstractCollectionpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class java.util.AbstractCollectionpublic boolean add(java.lang.Object o)
This implementation always throws an UnsupportedOperationException.
add in interface java.util.Collectionadd in interface java.util.Setadd in class java.util.AbstractCollectiono - element whose presence in this collection is to be ensured.java.lang.UnsupportedOperationException - if the add method is not supported by this collection.java.lang.NullPointerException - if this collection does not permit null elements, and the specified element is null.java.lang.ClassCastException - if the class of the specified element prevents it from being added to this collection.java.lang.IllegalArgumentException - if some aspect of this element prevents it from being added to this collection.public boolean remove(java.lang.Object o)
e such that (o==null ? e==null : o.equals(e)), if the set contains such an element. Returns true if the set contained the specified element (or equivalently, if the set changed as a result of the call). (The set will not contain the specified element once the call returns.)remove in interface java.util.Collectionremove in interface java.util.Setremove in class java.util.AbstractCollectiono - object to be removed from this set, if present.java.lang.ClassCastException - if the type of the specified element is incompatible with this set (optional).java.lang.NullPointerException - if the specified element is null and this set does not support null elements (optional).java.lang.UnsupportedOperationException - if the remove method is not supported by this set.protected CompositeAddressProvider.AddressIterator ensureInternalIterator()
protected java.util.List getConfiguredAddresses(AddressProvider provider)
provider - the address provider
|
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 | |||||||