Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.tangosol.net
Class CompositeAddressProvider.SingleProvider

    java.lang.Object
      com.tangosol.net.CompositeAddressProvider.SingleProvider

All Implemented Interfaces:
  AddressProvider

Enclosing class:
  CompositeAddressProvider

    protected class CompositeAddressProvider.SingleProvider

extends java.lang.Object
implements AddressProvider

AddressProvider wrapper for a single address dynamically added to this AddressSet.

Field Summary
`protected java.net.InetSocketAddress` | `m_address` The single address that this AddressProvider represents.
`protected boolean` | `m_fExhausted` Is this AddressProvider exhausted?

Constructor Summary
`protected` | `CompositeAddressProvider.SingleProvider(java.net.InetSocketAddress address)` Constructor

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 `AddressProvider.getNextAddress()` method.
`boolean` | `equals(java.lang.Object o)` AddressProvider instances are considered equivalent iff they consistently produce the same resulting set of addresses.
`java.net.InetSocketAddress` | `getNextAddress()` Obtain a next available address to use.
`int` | `hashCode()` Return the hash code for this AddressProvider.
`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 `AddressProvider.getNextAddress()` method has failed.

Field Detail

### m_address

    protected java.net.InetSocketAddress m_address

  The single address that this AddressProvider represents.

### m_fExhausted

    protected boolean m_fExhausted

  Is this AddressProvider exhausted?

Constructor Detail

### CompositeAddressProvider.SingleProvider

    protected CompositeAddressProvider.SingleProvider(java.net.InetSocketAddress address)

  Constructor

Method Detail

### getNextAddress

    public 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 `AddressProvider.accept()` method.

  Specified by:
    `getNextAddress` in interface `AddressProvider`
  Returns:
    the next available address or null if the list of available addresses was exhausted

### accept

    public void accept()

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

  Specified by:
    `accept` in interface `AddressProvider`

### reject

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

  Specified by:
    `reject` in interface `AddressProvider`
  Parameters:
    `eCause` - (optional) an exception that carries the reason why the the caller rejected the previously returned address

### equals

    public boolean equals(java.lang.Object o)

  AddressProvider instances are considered equivalent iff they consistently produce the same resulting set of addresses.

  Note: the general contract of `hashCode` and `equals()` should be preserved; AddressProviders that are "equal" should produce the same hashCode.

  Specified by:
    `equals` in interface `AddressProvider`
  Parameters:
    `o` - the Object to compare this AddressProvider to for equality
  Returns:
    true iff this AddressProvider is equal to the specified object

### hashCode

    public int hashCode()

  Return the hash code for this AddressProvider.

  Specified by:
    `hashCode` in interface `AddressProvider`
  Returns:
    the hash code for this AddressProvider

Overview | Package | Class | Tree | Index | Help

Oracle® Coherence Java API Reference
v3.5.3
E15583-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000, 2010, Oracle. All rights reserved.