public class

GlobalConfiguration

extends Object
implements IGlobalConfiguration
java.lang.Object
   ↳ com.android.tradefed.config.GlobalConfiguration

Class Overview

An IGlobalConfiguration implementation that stores the loaded config objects in a map

Summary

Constants
String DEVICE_MONITOR_TYPE_NAME
String DEVICE_REQUIREMENTS_TYPE_NAME
String HOST_OPTIONS_TYPE_NAME
Public Methods
static List<String> createGlobalConfiguration(String[] args)
Sets up the GlobalConfiguration singleton for this TF instance.
Object getConfigurationObject(String typeName)
List<?> getConfigurationObjectList(String typeName)
String getDescription()
IDeviceMonitor getDeviceMonitor()
Gets the IDeviceMonitor from the global config.
IDeviceSelection getDeviceRequirements()
Gets the IDeviceSelection to use from the configuration.
static IGlobalConfiguration getInstance()
Returns a reference to the singleton GlobalConfiguration instance for this TF instance.
String getName()
void injectOptionValue(String optionName, String optionKey, String optionValue)
Inject a option value into the set of configuration objects.
void injectOptionValue(String optionName, String optionValue)
Inject a option value into the set of configuration objects.
void printCommandUsage(boolean importantOnly, PrintStream out)
Outputs a command line usage help text for this configuration to given printStream.
void setConfigurationObject(String typeName, Object configObject)
void setConfigurationObjectList(String typeName, List<?> configList)
Generic method to set the config object list for the given name, replacing any existing value.
void setDeviceMonitor(IDeviceMonitor monitor)
Set the IDeviceMonitor.
void setDeviceRequirements(IDeviceSelection devRequirements)
Set the IDeviceSelection, replacing any existing values.
List<String> setOptionsFromCommandLineArgs(List<String> listArgs)
Set the global config Option fields with given set of command line arguments

void validateOptions()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.android.tradefed.config.IGlobalConfiguration

Constants

public static final String DEVICE_MONITOR_TYPE_NAME

Constant Value: "device_monitor"

public static final String DEVICE_REQUIREMENTS_TYPE_NAME

Constant Value: "device_requirements"

public static final String HOST_OPTIONS_TYPE_NAME

Constant Value: "host_options"

Public Methods

public static List<String> createGlobalConfiguration (String[] args)

Sets up the GlobalConfiguration singleton for this TF instance. Must be called once and only once, before anything attempts to call

Throws
IllegalStateException if called more than once
ConfigurationException

public Object getConfigurationObject (String typeName)

public List<?> getConfigurationObjectList (String typeName)

public String getDescription ()

Returns

public IDeviceMonitor getDeviceMonitor ()

Gets the IDeviceMonitor from the global config.

Returns
  • the IDeviceMonitor from the global config, or null if none was specified.

public IDeviceSelection getDeviceRequirements ()

Gets the IDeviceSelection to use from the configuration. Represents a global filter on which devices the DeviceManager can see.

Returns

public static IGlobalConfiguration getInstance ()

Returns a reference to the singleton GlobalConfiguration instance for this TF instance.

Throws
IllegalStateException if has not already been called.

public String getName ()

Returns

public void injectOptionValue (String optionName, String optionKey, String optionValue)

Inject a option value into the set of configuration objects.

Useful to provide values for options that are generated dynamically.

Parameters
optionName the map option name
optionKey the map option key
optionValue the map option value

public void injectOptionValue (String optionName, String optionValue)

Inject a option value into the set of configuration objects.

Useful to provide values for options that are generated dynamically.

Parameters
optionName the option name
optionValue the option value(s)

public void printCommandUsage (boolean importantOnly, PrintStream out)

Outputs a command line usage help text for this configuration to given printStream.

Parameters
out the PrintStream to use.
Throws
ConfigurationException}
ConfigurationException

public void setConfigurationObject (String typeName, Object configObject)

public void setConfigurationObjectList (String typeName, List<?> configList)

Generic method to set the config object list for the given name, replacing any existing value.

Parameters
typeName the unique name of the config object type.
configList the config object list

public void setDeviceMonitor (IDeviceMonitor monitor)

Set the IDeviceMonitor.

Parameters
monitor The monitor

public void setDeviceRequirements (IDeviceSelection devRequirements)

Set the IDeviceSelection, replacing any existing values. This sets a global device filter on which devices the DeviceManager can see.

public List<String> setOptionsFromCommandLineArgs (List<String> listArgs)

Set the global config Option fields with given set of command line arguments

Parameters
listArgs the command line arguments
Returns
  • the unconsumed arguments

public void validateOptions ()