|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.zookeeper.client.StaticHostProvider
public final class StaticHostProvider
Most simple HostProvider, resolves only on instantiation.
| Constructor Summary | |
|---|---|
StaticHostProvider(Collection<InetSocketAddress> serverAddresses)
Constructs a SimpleHostSet. |
|
| Method Summary | |
|---|---|
InetSocketAddress |
next(long spinDelay)
The next host to try to connect to. |
void |
onConnected()
Notify the HostProvider of a successful connection. |
int |
size()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StaticHostProvider(Collection<InetSocketAddress> serverAddresses)
throws UnknownHostException
serverAddresses - possibly unresolved ZooKeeper server addresses
UnknownHostException
IllegalArgumentException - if serverAddresses is empty or resolves to an empty list| Method Detail |
|---|
public int size()
size in interface HostProviderpublic InetSocketAddress next(long spinDelay)
HostProvider
next in interface HostProviderspinDelay - Milliseconds to wait if all hosts have been tried once.public void onConnected()
HostProvider
onConnected in interface HostProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||