|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.smila.zookeeper.internal.ZooKeeperServiceImpl
public class ZooKeeperServiceImpl
OSGi services that configures and starts a ZooKeeper, either stand-alone if we are not running in a multi-node cluster or without ClusterConfigService at all or as distributed on the complete cluster.
| Field Summary |
|---|
| Fields inherited from interface org.eclipse.smila.zookeeper.ZooKeeperService |
|---|
BUNDLE_ID |
| Constructor Summary | |
|---|---|
ZooKeeperServiceImpl()
|
|
| Method Summary | |
|---|---|
protected void |
activate(ComponentContext context)
OSGi Declarative Services service activation method. |
void |
closeClient()
close the client quietly. |
protected void |
deactivate(ComponentContext context)
OSGi Declarative Services service deactivation method. |
ZooKeeper |
getClient()
get zookeeper client, create if it doesn't exist. |
long |
getFailSafetyLevel()
|
AnyMap |
getServerState()
|
void |
process(WatchedEvent event)
we only use Watches for zookeeper client state change events. |
void |
registerWatcher(Watcher watcher)
register a watcher for ZooKeeper events. |
void |
setClusterConfigService(ClusterConfigService clusterConfigService)
set new ClusterConfigService. |
void |
unregisterWatcher(Watcher watcher)
unregister a watcher for ZooKeeper events. |
void |
unsetClusterConfigService(ClusterConfigService clusterConfigService)
remove a ClusterConfigService. |
void |
waitForClientConnected()
wait until the zookeeper client is (re)connected. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ZooKeeperServiceImpl()
| Method Detail |
|---|
public ZooKeeper getClient()
throws java.io.IOException,
ClusterConfigException
getClient in interface ZooKeeperServicejava.io.IOException - error creating client
ClusterConfigException - if the cluster configuration cannot be readpublic void closeClient()
closeClient in interface ZooKeeperServicepublic long getFailSafetyLevel()
getFailSafetyLevel in interface ZooKeeperServiceprotected void activate(ComponentContext context)
context - OSGi service component context.protected void deactivate(ComponentContext context)
context - OSGi service component context.public void setClusterConfigService(ClusterConfigService clusterConfigService)
clusterConfigService - new ClusterConfigServicepublic void unsetClusterConfigService(ClusterConfigService clusterConfigService)
public void waitForClientConnected()
ZooKeeperService
waitForClientConnected in interface ZooKeeperServicepublic void process(WatchedEvent event)
public void registerWatcher(Watcher watcher)
registerWatcher in interface ZooKeeperServicepublic void unregisterWatcher(Watcher watcher)
unregisterWatcher in interface ZooKeeperServicepublic AnyMap getServerState()
getServerState in interface ZooKeeperService
|
SMILA 1.0 API documentation | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||