ConfigurationFactory.ConfigLoader

protected class ConfigurationFactory.ConfigLoader
extends Object

java.lang.Object
   ↳ com.android.tradefed.config.ConfigurationFactory.ConfigLoader


Implementation of IConfigDefLoader that tracks the included configurations from one root config, and throws an exception on circular includes.

Summary

Public constructors

ConfigLoader(boolean isGlobalConfig)

Public methods

ConfigurationDef getConfigurationDef(String name, templateMap)

boolean isGlobalConfig()

void loadIncludedConfiguration(ConfigurationDef def, String parentName, String name, String deviceTagObject, templateMap, templateSeen)

Configs that are bundled inside the tradefed.jar can only include other configs also bundled inside tradefed.jar.

Protected methods

String findConfigName(String name, String parentName)

Find config's name based on its name and its parent name.

boolean isBundledConfig(String name)

Returns true if it is a config file found inside the classpath.

boolean isTrackableConfig(String name)

Should track the config's life cycle or not.

void trackConfig(String name, ConfigurationDef def)

Track config for dynamic loading.

Public constructors

ConfigLoader

public ConfigLoader (boolean isGlobalConfig)

Parameters
isGlobalConfig boolean

Public methods

getConfigurationDef

public ConfigurationDef getConfigurationDef (String name, 
                 templateMap)

Parameters
name String

templateMap

Returns
ConfigurationDef

Throws
ConfigurationException

isGlobalConfig

public boolean isGlobalConfig ()

Returns
boolean

loadIncludedConfiguration

public void loadIncludedConfiguration (ConfigurationDef def, 
                String parentName, 
                String name, 
                String deviceTagObject, 
                 templateMap, 
                 templateSeen)

Configs that are bundled inside the tradefed.jar can only include other configs also bundled inside tradefed.jar. However, local (external) configs can include both local (external) and bundled configs.

Parameters
def ConfigurationDef

parentName String

name String

deviceTagObject String

templateMap

templateSeen

Throws
ConfigurationException

Protected methods

findConfigName

protected String findConfigName (String name, 
                String parentName)

Find config's name based on its name and its parent name. This is used to properly handle bundle configs and local configs.

Parameters
name String: config's name

parentName String: config's parent's name.

Returns
String the config's full name.

Throws
com.android.tradefed.config.ConfigurationException
ConfigurationException

isBundledConfig

protected boolean isBundledConfig (String name)

Returns true if it is a config file found inside the classpath.

Parameters
name String

Returns
boolean

isTrackableConfig

protected boolean isTrackableConfig (String name)

Should track the config's life cycle or not.

Parameters
name String: config's name

Returns
boolean true if the config is trackable, otherwise false.

trackConfig

protected void trackConfig (String name, 
                ConfigurationDef def)

Track config for dynamic loading. Right now only local files are supported.

Parameters
name String: config's name

def ConfigurationDef: config's def.