CoherenceTM v3.4
Copyright© 2000-2008 by Oracle Corporation

com.tangosol.net
Interface AddressProvider

All Known Implementing Classes:
ConfigurableAddressProvider

public interface AddressProvider

The AddressProvider is an interface that serves as a means to provide addresses to a consumer. Simple implementations could be backed by a static list; more complex ones could use dynamic discovery protocols.

Since:
Coherence 3.4
Author:
gg,jh 2008-08-14

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 getNextAddress() method.
 java.net.InetSocketAddress getNextAddress()
          Obtain a next available address to use.
 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 getNextAddress() method has failed.
 

Method Detail

getNextAddress

java.net.InetSocketAddress getNextAddress()
Obtain a next available address to use. If the caller can successfully use the returned address (e.g. a connection was established), it should call the AddressProvider's accept() method.

Returns:
the next available address or null if the list of available addresses was exhausted

accept

void accept()
This method should be called by the client immediately after it determines that it can successfully use an address returned by the getNextAddress() method.


reject

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 getNextAddress() method has failed.

Parameters:
eCause - (optional) an exception that carries the reason why the the caller rejected the previously returned address

CoherenceTM v3.4
Copyright© 2000-2008 by Oracle Corporation