org.apache.curator.ensemble.fixed
Class FixedEnsembleProvider

java.lang.Object
  extended by org.apache.curator.ensemble.fixed.FixedEnsembleProvider
All Implemented Interfaces:
Closeable, EnsembleProvider

public class FixedEnsembleProvider
extends Object
implements EnsembleProvider

Standard ensemble provider that wraps a fixed connection string


Constructor Summary
FixedEnsembleProvider(String connectionString)
          The connection string to use
 
Method Summary
 void close()
          Curator will call this method when CuratorZookeeperClient.close() is called
 String getConnectionString()
          Return the current connection string to use.
 void start()
          Curator will call this method when CuratorZookeeperClient.start() is called
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedEnsembleProvider

public FixedEnsembleProvider(String connectionString)
The connection string to use

Parameters:
connectionString - connection string
Method Detail

start

public void start()
           throws Exception
Description copied from interface: EnsembleProvider
Curator will call this method when CuratorZookeeperClient.start() is called

Specified by:
start in interface EnsembleProvider
Throws:
Exception - errors

close

public void close()
           throws IOException
Description copied from interface: EnsembleProvider
Curator will call this method when CuratorZookeeperClient.close() is called

Specified by:
close in interface Closeable
Specified by:
close in interface EnsembleProvider
Throws:
IOException - errors

getConnectionString

public String getConnectionString()
Description copied from interface: EnsembleProvider
Return the current connection string to use. Curator will call this each time it needs to create a ZooKeeper instance

Specified by:
getConnectionString in interface EnsembleProvider
Returns:
connection string (per ZooKeeper.ZooKeeper(String, int, Watcher) etc.)


Copyright © 2011–2014 The Apache Software Foundation. All rights reserved.