|
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
com.tangosol.util.Base
com.tangosol.net.RefreshableAddressProvider
public class RefreshableAddressProvider
A RefreshableAddressProvider is an AddressProvider implementation that wraps another AddressProvider and refresh the address list of the provider asynchronously. This ensures that the behaviour of this AddressProvider will be performant (specifically non-blocking).
Nested Class Summary | |
---|---|
protected class |
RefreshableAddressProvider.CircularIterator An Iterator implementation that can be converted into circular mode to allow the remaining addresses and previously skipped addresses to be used; typically set once an address has been accepted . |
protected class |
RefreshableAddressProvider.RefreshThread |
Field Summary | |
---|---|
protected Daemon |
f_daemonRefresh The refresh daemon. |
protected RefreshableAddressProvider.CircularIterator |
f_iterator An Iterator over the cached set of addresses. |
protected long |
f_lRefresh The interval with which to attempt to refresh the address list. |
protected AddressProvider |
m_apRefresh The address provider to be refreshed. |
protected long |
m_ldtLastRefresh The last timestamp when the address list was refreshed. |
protected java.util.List |
m_listCache The cached addresses. |
static long |
REFRESH_DEFAULT Default refresh time of 10 seconds. |
Constructor Summary | |
---|---|
RefreshableAddressProvider(AddressProvider ap) Construct a RefreshableAddressProvider with the given AddressProvider using default refresh interval |
|
RefreshableAddressProvider(AddressProvider ap, long lRefresh) Construct a RefreshableAddressProvider with the specified AddressProvider and refresh interval |
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 |
ensureRefreshThread() Start the refresh thread if not already running. |
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. |
java.net.InetSocketAddress |
getNextAddress() Covariant of SocketAddressProvider.getNextAddress() which returns an InetSocketAddress . |
protected java.net.InetSocketAddress |
getNextAddressInternal() Obtain the next available address to use. |
int |
hashCode() Return the hash code for this SocketAddressProvider. |
protected void |
refreshAddressList() Refresh the cached address list using the underlying provider. |
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. |
Field Detail |
---|
public static final long REFRESH_DEFAULT
protected final long f_lRefresh
protected final Daemon f_daemonRefresh
protected final RefreshableAddressProvider.CircularIterator f_iterator
protected volatile java.util.List m_listCache
protected long m_ldtLastRefresh
protected AddressProvider m_apRefresh
Constructor Detail |
---|
public RefreshableAddressProvider(AddressProvider ap)
public RefreshableAddressProvider(AddressProvider ap, long lRefresh)
lRefresh
- the refresh intervalMethod Detail |
---|
protected java.net.InetSocketAddress getNextAddressInternal()
public 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 SocketAddressProvider
o
- the Object to compare this SocketAddressProvider to for equalitypublic int hashCode()
hashCode
in interface SocketAddressProvider
public final java.net.InetSocketAddress getNextAddress()
SocketAddressProvider.getNextAddress()
which returns an InetSocketAddress
. If the internal iterator used to return addresses is exhausted then a new iterator is initialised and null is returned.getNextAddress
in interface AddressProvider
getNextAddress
in interface SocketAddressProvider
public final void accept()
SocketAddressProvider.getNextAddress()
method.accept
in interface SocketAddressProvider
public final void reject(java.lang.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 java.lang.String[] getAddressDescriptions()
getAddressDescriptions
in interface DescribableAddressProvider
protected void refreshAddressList()
protected void ensureRefreshThread()
|
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 |