#include <coherence/net/AddressProvider.hpp>
Inherits Object.
Inherited by ConfigurableAddressProvider [virtual], and SingleAddressProvider [virtual].
Simple implementations could be backed by a static list; more complex ones could use dynamic discovery protocols.
Public Types | |
| typedef spec::Handle | Handle |
| AddressProvider Handle definition. | |
| typedef spec::View | View |
| AddressProvider View definition. | |
| typedef spec::Holder | Holder |
| AddressProvider Holder definition. | |
Public Member Functions | |
| virtual InetSocketAddress::View | getNextAddress ()=0 |
| Obtain a next available address to use. | |
| virtual void | accept ()=0 |
| This method should be called by the client immediately after it determines that it can successfully use an address returned by the getNextAddress method. | |
| virtual void | reject (Exception::Holder oheCause)=0 |
| 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. | |
| virtual InetSocketAddress::View getNextAddress | ( | ) | [pure virtual] |
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()
Implemented in ConfigurableAddressProvider, and SingleAddressProvider.
| virtual void reject | ( | Exception::Holder | oheCause | ) | [pure virtual] |
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.
| oheCause | (optional) an exception that carries the reason why the the caller rejected the previously returned address |
Implemented in ConfigurableAddressProvider, and SingleAddressProvider.