org.alfresco.bm.config
Interface ConfigService

All Superinterfaces:
org.alfresco.bm.config.ConfigConstants
All Known Implementing Classes:
ZkConfigService

public interface ConfigService
extends org.alfresco.bm.config.ConfigConstants

Interface for classes that are able to provide configuration specifically for the benchmark server.

Since:
1.0
Author:
Derek Hulley

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
 
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
 String setProperties(ConfigDataListener listener, boolean ephemeral, boolean sequential, Properties properties, String... path)
          Set properties against a path
 

Method Detail

exists

boolean exists(String... path)
Check if a given path exists

Parameters:
path - the path (over and above any root path) to check
Returns:
true if the path exists

getString

String getString(ConfigDataListener listener,
                 String... path)
Retrieve string data from a given path

Parameters:
listener - a listener to call if the data changes (null allowed)
path - the path to the data
Returns:
Returns the data or null if not found

getProperties

Properties getProperties(ConfigDataListener listener,
                         String... path)
Retrieve the properties from a given path

Parameters:
listener - a listener to call if the properties change (null allowed)
path - the path to the properties
Returns:
Java properties from the location (never null)

setProperties

String setProperties(ConfigDataListener listener,
                     boolean ephemeral,
                     boolean sequential,
                     Properties properties,
                     String... path)
Set properties against a path

Parameters:
listener - a listener to call if the properties change (null allowed)
ephemeral - true if the path should be removed when the server stops
sequential - true if the last path element must have an auto-incrementing value attached i.e. if the final path element is always new
properties - the properties to set
path - the path to the properties
Returns:
the final path element, which will be different from the one supplied if it is auto-incrementing

getChildren

Set<String> getChildren(ConfigChildListener listener,
                        String... path)
Retrieve the children of a given path

Parameters:
listener - a listener to call if the the children change (null allowed)
path - the path to the parent
Returns:
Returns the current children of the provided path (never null)

getClassLoader

ClassLoader getClassLoader(ConfigClassesListener listener,
                           ClassLoader parent,
                           String... path)
Retrieve a ClassLoader rooted at the given location

Parameters:
listener - a listener to call if the classes change (null allowed)
parent - the parent ClassLoader
path - the path to the classes root (akin to a classpath)
Returns:
Returns the new ClassLoader

getJarLoader

ClassLoader getJarLoader(ConfigClassesListener listener,
                         ClassLoader parent,
                         String... path)
Retrieve a URLClassLoader rooted at the given location. The children of the given path are found and each is treated as a separate jar file.

Parameters:
listener - a listener to call if the classes change (null allowed)
parent - the parent ClassLoader
path - the path to the jar
Returns:
Returns the new ClassLoader


Copyright © 2012. All Rights Reserved.