public abstract class ConfigurationManagerImplBase extends Object implements ConfigurationManager
declareParameters(String, ConfigurationParameter[], ConfigurationParameterSettings, String, Settings)
and lookupSharedParamNoLinks(String)
.Modifier and Type | Field and Description |
---|---|
protected static char |
GROUP_SEPARATOR
Character that separates parameter name from group name in the parameter map.
|
protected Map<String,String> |
mLinkMap
Map the fully-qualified name of a parameter to the fully-qualified name of the parameter it is
linked to (from which it takes its value).
|
protected static String |
SESSION_CONFIGURATION_KEY
Key under which to store configuration information in the Session object.
|
Constructor and Description |
---|
ConfigurationManagerImplBase() |
Modifier and Type | Method and Description |
---|---|
void |
createContext(String aContextName,
ResourceMetaData aResourceMetaData,
Settings externalOverrides)
Creates and sets up a new configuration parameter context.
|
protected void |
declareParameters(String aGroupName,
ConfigurationParameter[] aParams,
ConfigurationParameterSettings aSettings,
String aContextName,
Settings aExternalOverrides)
Called during creation of a new context.
|
ConfigurationParameterDeclarations |
getConfigParameterDeclarations(String aContextName)
Gets the ConfigurationParameterDeclarations for the given context.
|
Object |
getConfigParameterValue(String aQualifiedParameterName)
Retrieves the value for a configuration parameter.
|
Object |
getConfigParameterValue(String aQualifiedParameterName,
String aGroupName)
Retrieves the value for a configuration parameter in a group.
|
ConfigurationParameterSettings |
getCurrentConfigParameterSettings(String aContextName)
Gets an object containing the current settings for all configuration parameters within the
given context.
|
protected String |
getLink(String aCompleteName)
Gets the name of the parameter to which a given parameter is linked.
|
protected Class<?> |
getParameterExpectedValueClass(ConfigurationParameter aParam)
Get the Java class of the expected value of the specified parameter.
|
Session |
getSession() |
protected Object |
lookup(String aCompleteName)
Does a direct lookup of a complete name, including the group.
|
protected abstract Object |
lookupSharedParamNoLinks(String aCompleteName)
Looks up the value of a shared parameter, but does NOT follow links.
|
protected String |
makeQualifiedName(String aContextName,
String aParamName,
String aGroupName)
Creates a qualified parameter name.
|
void |
reconfigure(String aContextName)
Completes the reconfiguration of parameters within the specified context.
|
void |
setConfigParameterValue(String aQualifiedParamName,
Object aValue)
Sets the value of a configuration parameter.
|
void |
setConfigParameterValue(String aQualifiedParamName,
String aGroupName,
Object aValue)
Sets the value of a configuration parameter in a group.
|
void |
setSession(Session aSession)
Sets the current
Session . |
protected static final char GROUP_SEPARATOR
protected static final String SESSION_CONFIGURATION_KEY
protected final Map<String,String> mLinkMap
public void setSession(Session aSession)
ConfigurationManager
Session
. The Configuration Manager uses the Session
object to store changes to configuration settings made by calling the
setConfigParameterValue
methods. This ensures that in a multi-client deployment
those settings only apply to the same client that set them.
Code that uses this class must be sure to call setSession
before using the other
methods (except createContext
) on this class.
setSession
in interface ConfigurationManager
aSession
- the session object used to store configuration parameter overrides made by a
particular client.public Session getSession()
public void createContext(String aContextName, ResourceMetaData aResourceMetaData, Settings externalOverrides) throws ResourceConfigurationException
ConfigurationManager
createContext
in interface ConfigurationManager
aContextName
- the name of the context in which the configuration parameter is being accessed. This
corresponds to the path through the aggregate resource, e.g /subAE1/annotator1.aResourceMetaData
- metadata object containing the configuration parameter declarations and settings.externalOverrides
- the external overridesResourceConfigurationException
- if the configuration settings are invalidpublic Object getConfigParameterValue(String aQualifiedParameterName)
ConfigurationManager
getConfigParameterValue
in interface ConfigurationManager
aQualifiedParameterName
- the fully-qualified configuration parameter name. This is of the form
ContextName + / + ParameterName
.null
is returned.public Object getConfigParameterValue(String aQualifiedParameterName, String aGroupName)
ConfigurationManager
getConfigParameterValue
in interface ConfigurationManager
aQualifiedParameterName
- the fully-qualified configuration parameter name. This is of the form
ContextName + / + ParameterName
.aGroupName
- the name of the parameter groupnull
is returned.public void setConfigParameterValue(String aQualifiedParamName, Object aValue)
ConfigurationManager
ConfigurationManager.reconfigure(String)
is called.setConfigParameterValue
in interface ConfigurationManager
aQualifiedParamName
- the fully-qualified configuration parameter name. This is of the form
ContextName + / + ParameterName
.aValue
- the value to assign to the parameterpublic void setConfigParameterValue(String aQualifiedParamName, String aGroupName, Object aValue)
ConfigurationManager
ConfigurationManager.reconfigure(String)
is called.setConfigParameterValue
in interface ConfigurationManager
aQualifiedParamName
- the fully-qualified configuration parameter name. This is of the form
ContextName + / + ParameterName
.aGroupName
- the name of a configuration group. If this parameter is null
, this method
will have the same effect as setParameterValue(String,Object)
.aValue
- the value to assign to the parameterpublic void reconfigure(String aContextName) throws ResourceConfigurationException
ConfigurationManager
reconfigure
in interface ConfigurationManager
aContextName
- the name of the context being reconfiguredResourceConfigurationException
- if the new configuration is invalidpublic ConfigurationParameterDeclarations getConfigParameterDeclarations(String aContextName)
ConfigurationManager
getConfigParameterDeclarations
in interface ConfigurationManager
aContextName
- the name for which to get the parameter declarationsnull
if there are no declarations.public ConfigurationParameterSettings getCurrentConfigParameterSettings(String aContextName)
ConfigurationManager
getCurrentConfigParameterSettings
in interface ConfigurationManager
aContextName
- name of context for which to retrieve parameter settingsprotected Object lookup(String aCompleteName)
aCompleteName
- complete name, of the form context/parameter$groupprotected void declareParameters(String aGroupName, ConfigurationParameter[] aParams, ConfigurationParameterSettings aSettings, String aContextName, Settings aExternalOverrides) throws ResourceConfigurationException
aGroupName
- name of parameter group, null if noneaParams
- parameter declarationsaSettings
- settings for parametersaContextName
- name of context containing this parameteraExternalOverrides
- settings for parameters with external overridesResourceConfigurationException
- passthruprotected String getLink(String aCompleteName)
aCompleteName
- complete name, of the form context/parameter$groupaCompleteName
is linked to another parameter,
the complete name of that parameter is returned. Otherwise, null is returned.protected abstract Object lookupSharedParamNoLinks(String aCompleteName)
aCompleteName
- complete name, of the form context/parameter$groupprotected String makeQualifiedName(String aContextName, String aParamName, String aGroupName)
aContextName
- the name of the context containing this parameteraParamName
- the configuration parameter nameaGroupName
- the name of the group containining the parameter, null if noneprotected Class<?> getParameterExpectedValueClass(ConfigurationParameter aParam)
aParam
- configuration parameter declaration informationCopyright © 2006–2022 The Apache Software Foundation. All rights reserved.