|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.alfresco.config.zookeeper.ZkConfigService
public class ZkConfigService
ZooKeeper-based configuration loader that, starting from a root path, loads benchmark-related configurations.
| Field Summary |
|---|
| Fields inherited from interface org.alfresco.config.ConfigService |
|---|
SEPARATOR |
| Constructor Summary | |
|---|---|
ZkConfigService(org.I0Itec.zkclient.ZkClient zk,
String zkPath)
Construct the configuration loader. |
|
| Method Summary | |
|---|---|
void |
delete(String... path)
Recursive delete of a path without any option to recover. |
boolean |
exists(String... path)
Check if a given path exists |
Set<String> |
getChildren(ConfigChildListener listener,
String... path)
Retrieve the children of a given path |
ClassLoader |
getClassLoader(ConfigClassesListener listener,
ClassLoader parent,
String... path)
Retrieve a ClassLoader rooted at the given location |
ClassLoader |
getJarLoader(ConfigClassesListener listener,
ClassLoader parent,
String... path)
Retrieve a URLClassLoader rooted at the given location. |
Properties |
getProperties(ConfigDataListener listener,
String... path)
Retrieve the properties from a given path |
String |
getString(ConfigDataListener listener,
String... path)
Retrieve string data from a given path |
void |
onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
Handles start and stop by checking configuration and cleaning caches respectively. |
void |
setApplicationContext(org.springframework.context.ApplicationContext ctx)
Record the context that started this instance. |
String |
setData(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
byte[] bytes,
String... path)
Set binary data |
String |
setProperties(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
Properties properties,
String... path)
Set properties against a path |
String |
setString(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
String value,
String... path)
Retrieve string data from a given path |
void |
shutdown()
Drop any stored configuration and discard any watchers |
boolean |
updateData(byte[] bytes,
String... path)
Update data at a given path |
boolean |
updateProperties(Properties properties,
String... path)
Update properties at a given path |
boolean |
updateString(String value,
String... path)
Update a specific string value |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ZkConfigService(org.I0Itec.zkclient.ZkClient zk,
String zkPath)
zk - the ZooKeeper clientzkPath - the root path to use in ZK| Method Detail |
|---|
public void setApplicationContext(org.springframework.context.ApplicationContext ctx)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic void onApplicationEvent(org.springframework.context.event.ApplicationContextEvent event)
onApplicationEvent in interface org.springframework.context.ApplicationListener<org.springframework.context.event.ApplicationContextEvent>public void shutdown()
public boolean exists(String... path)
exists in interface ConfigServicepath - the path (over and above any root path) to check
public void delete(String... path)
delete in interface ConfigServicepath - the path (over and above any root path)
public String getString(ConfigDataListener listener,
String... path)
getString in interface ConfigServicelistener - a listener to call if the data changes (null allowed)path - the path to the data
public String setData(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
byte[] bytes,
String... path)
ConfigService
setData in interface ConfigServicelistener - a listener to call if the properties change (null allowed)ephemeral - true if the path should be removed when the server stopssequential - true if the last path element must have an auto-incrementing
value attached i.e. if the final path element is always newbytes - the data to setpath - the path to the properties
public boolean updateData(byte[] bytes,
String... path)
ConfigService
updateData in interface ConfigServicebytes - the properties to setpath - the path to the properties
public String setString(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
String value,
String... path)
ConfigService
setString in interface ConfigServicelistener - a listener to call if the data changes (null allowed)ephemeral - true if the path should be removed when the server stopssequential - true if the last path element must have an auto-incrementing
value attached i.e. if the final path element is always newvalue - the value to setpath - the path to the properties
public boolean updateString(String value,
String... path)
ConfigService
updateString in interface ConfigServicevalue - the value to setpath - the path to the properties
public Properties getProperties(ConfigDataListener listener,
String... path)
getProperties in interface ConfigServicelistener - a listener to call if the properties change (null allowed)path - the path to the properties
public String setProperties(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
Properties properties,
String... path)
ConfigService
setProperties in interface ConfigServicelistener - a listener to call if the properties change (null allowed)ephemeral - true if the path should be removed when the server stopssequential - true if the last path element must have an auto-incrementing
value attached i.e. if the final path element is always newproperties - the properties to setpath - the path to the properties
public boolean updateProperties(Properties properties,
String... path)
ConfigService
updateProperties in interface ConfigServiceproperties - the properties to setpath - the path to the properties
public Set<String> getChildren(ConfigChildListener listener,
String... path)
ConfigService
getChildren in interface ConfigServicelistener - a listener to call if the the children change (null allowed)path - the path to the parent
public ClassLoader getClassLoader(ConfigClassesListener listener,
ClassLoader parent,
String... path)
ConfigServiceClassLoader rooted at the given location
getClassLoader in interface ConfigServicelistener - a listener to call if the classes change (null allowed)parent - the parent ClassLoaderpath - the path to the classes root (akin to a classpath)
ClassLoader
public ClassLoader getJarLoader(ConfigClassesListener listener,
ClassLoader parent,
String... path)
ConfigServiceURLClassLoader rooted at the given location. The children of the given
path are found and each is treated as a separate jar file.
getJarLoader in interface ConfigServicelistener - a listener to call if the classes change (null allowed)parent - the parent ClassLoaderpath - the path to the jar
ClassLoader
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||