Oracle Coherence for C++ API
Release 3.7.1.0

E22845-01

AddressProvider Class Reference

#include <coherence/net/AddressProvider.hpp>

Inherits Object.

Inherited by ConfigurableAddressProvider [virtual].

List of all members.


Detailed Description

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.

Author:
gg,jh 2008-08-14

gm 2008-08-25

Since:
Coherence 3.4
 

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.

Member Function Documentation

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()

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

Implemented in ConfigurableAddressProvider.

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.

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

Implemented in ConfigurableAddressProvider.


The documentation for this class was generated from the following file:
Copyright © 2000, 2011, Oracle and/or its affiliates. All rights reserved.