public final class StaticHostProvider extends Object implements HostProvider
| Constructor and Description |
|---|
StaticHostProvider(Collection<InetSocketAddress> serverAddresses)
Constructs a SimpleHostSet.
|
| Modifier and Type | Method and Description |
|---|---|
InetSocketAddress |
next(long spinDelay)
The next host to try to connect to.
|
void |
onConnected()
Notify the HostProvider of a successful connection.
|
int |
size() |
public StaticHostProvider(Collection<InetSocketAddress> serverAddresses) throws UnknownHostException
serverAddresses - possibly unresolved ZooKeeper server addressesUnknownHostExceptionIllegalArgumentException - if serverAddresses is empty or resolves to an empty listpublic int size()
size in interface HostProviderpublic InetSocketAddress next(long spinDelay)
HostProvidernext in interface HostProviderspinDelay - Milliseconds to wait if all hosts have been tried once.public void onConnected()
HostProvideronConnected in interface HostProviderCopyright © 2014 The Apache Software Foundation