|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.alfresco.bm.config.zookeeper.ZkConfigService
public class ZkConfigService
ZooKeeper-based configuration loader that, starting from a root path, loads benchmark-related configurations.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.alfresco.bm.config.ConfigConstants |
|---|
org.alfresco.bm.config.ConfigConstants.RunState |
| Field Summary |
|---|
| Fields inherited from interface org.alfresco.bm.config.ConfigConstants |
|---|
DEFAULT_RUNSTATE, DEFAULT_SERVER_ID, PATH_CLASSES, PATH_CLUSTERS, PATH_DEFINITION, PATH_JARS, PATH_LOADED, PATH_PROPERTIES, PATH_RUNS, PATH_SERVER, PATH_SERVERS, PATH_TESTS, PROP_CLUSTER, PROP_CONTROL_CLUSTER, PROP_CONTROL_RUN_STATE, PROP_EVENT_PROCESSOR_THREADS, PROP_MONGO_URI, PROP_SERVER_ID, PROP_TEST_NAME, PROP_TEST_RUN_FQN, PROP_TEST_RUN_NAME, SEPARATOR |
| Constructor Summary | |
|---|---|
ZkConfigService(org.I0Itec.zkclient.ZkClient zk,
String zkPath)
Construct the configuration loader. |
|
| Method Summary | |
|---|---|
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 |
setProperties(ConfigDataListener listener,
boolean ephemeral,
boolean sequential,
Properties properties,
String... path)
Set properties against a path |
void |
shutdown()
Drop any stored configuration and discard any watchers |
| 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 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 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 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 | |||||||||