|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.uima.resource.impl.ConfigurationManagerImplBase
public abstract class ConfigurationManagerImplBase
Convenience base class for Configuration Manager implementations. Subclasses just need to
implement the abstract methods
declareParameters(String, ConfigurationParameter[], ConfigurationParameterSettings, String, String)
and lookupSharedParamNoLinks(String)
.
Field Summary | |
---|---|
protected static char |
GROUP_SEPARATOR
Character that separates parameter name from group name in the parameter map. |
protected static java.lang.String |
SESSION_CONFIGURATION_KEY
Key under which to store configuration information in the Session object. |
Constructor Summary | |
---|---|
ConfigurationManagerImplBase()
|
Method Summary | |
---|---|
void |
createContext(java.lang.String aContextName,
ResourceMetaData aResourceMetaData)
Creates and sets up a new configuration parameter context. |
protected void |
declareParameters(java.lang.String aGroupName,
ConfigurationParameter[] aParams,
ConfigurationParameterSettings aSettings,
java.lang.String aContextName,
java.lang.String aParentContextName)
Called during creation of a new context. |
ConfigurationParameterDeclarations |
getConfigParameterDeclarations(java.lang.String aContextName)
Gets the ConfigurationParameterDeclarations for the given context. |
java.lang.Object |
getConfigParameterValue(java.lang.String aQualifiedParameterName)
Retrieves the value for a configuration parameter. |
java.lang.Object |
getConfigParameterValue(java.lang.String aQualifiedParameterName,
java.lang.String aGroupName)
Retrieves the value for a configuration parameter in a group. |
ConfigurationParameterSettings |
getCurrentConfigParameterSettings(java.lang.String aContextName)
Gets an object containing the current settings for all configuration parameters within the given context. |
protected java.lang.String |
getLink(java.lang.String aCompleteName)
Gets the name of the parameter to which a given parameter is linked. |
protected java.lang.Class<?> |
getParameterExpectedValueClass(ConfigurationParameter aParam)
Get the Java class of the expected value of the specified parameter. |
protected java.lang.Object |
lookup(java.lang.String aCompleteName)
Does a direct lookup of a complete name, including the group. |
protected abstract java.lang.Object |
lookupSharedParamNoLinks(java.lang.String aCompleteName)
Looks up the value of a shared parameter, but does NOT follow links. |
protected java.lang.String |
makeQualifiedName(java.lang.String aContextName,
java.lang.String aParamName,
java.lang.String aGroupName)
Creates a qualified parameter name. |
void |
reconfigure(java.lang.String aContextName)
Completes the reconfiguration of parameters within the specified context. |
void |
setConfigParameterValue(java.lang.String aQualifiedParamName,
java.lang.Object aValue)
Sets the value of a configuration parameter. |
void |
setConfigParameterValue(java.lang.String aQualifiedParamName,
java.lang.String aGroupName,
java.lang.Object aValue)
Sets the value of a configuration parameter in a group. |
void |
setSession(Session aSession)
Sets the current Session . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final char GROUP_SEPARATOR
protected static final java.lang.String SESSION_CONFIGURATION_KEY
Constructor Detail |
---|
public ConfigurationManagerImplBase()
Method Detail |
---|
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 void createContext(java.lang.String aContextName, ResourceMetaData aResourceMetaData) 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.
ResourceConfigurationException
- if the configuration settings are invalidpublic java.lang.Object getConfigParameterValue(java.lang.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 java.lang.Object getConfigParameterValue(java.lang.String aQualifiedParameterName, java.lang.String aGroupName)
ConfigurationManager
getConfigParameterValue
in interface ConfigurationManager
aQualifiedParameterName
- the fully-qualified configuration parameter name. This is of the form
ContextName + / + ParameterName
.
null
is
returned.public void setConfigParameterValue(java.lang.String aQualifiedParamName, java.lang.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(java.lang.String aQualifiedParamName, java.lang.String aGroupName, java.lang.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 effet as
setParameterValue(String,Object)
.aValue
- the value to assign to the parameter
public void reconfigure(java.lang.String aContextName) throws ResourceConfigurationException
ConfigurationManager
reconfigure
in interface ConfigurationManager
aContextName
- the name of the context being reconfigured
ResourceConfigurationException
- if the new configuration is invalidpublic ConfigurationParameterDeclarations getConfigParameterDeclarations(java.lang.String aContextName)
ConfigurationManager
getConfigParameterDeclarations
in interface ConfigurationManager
aContextName
- the name for which to get the parameter declarations
public ConfigurationParameterSettings getCurrentConfigParameterSettings(java.lang.String aContextName)
ConfigurationManager
getCurrentConfigParameterSettings
in interface ConfigurationManager
aContextName
- name of context for which to retrieve parameter settings
protected java.lang.Object lookup(java.lang.String aCompleteName)
aCompleteName
- complete name, of the form context/parameter$group
protected void declareParameters(java.lang.String aGroupName, ConfigurationParameter[] aParams, ConfigurationParameterSettings aSettings, java.lang.String aContextName, java.lang.String aParentContextName)
aGroupName
- name of parameter group, null if noneaParams
- parameter declarationsaSettings
- settings for parametersaContextName
- name of context containing this parameteraParentContextName
- name of parent context, null if noneprotected java.lang.String getLink(java.lang.String aCompleteName)
aCompleteName
- complete name, of the form context/parameter$group
aCompleteName
is linked to another parameter,
the complete name of that parameter is returned. Otherwise, null is returned.protected abstract java.lang.Object lookupSharedParamNoLinks(java.lang.String aCompleteName)
aCompleteName
- complete name, of the form context/parameter$group
protected java.lang.String makeQualifiedName(java.lang.String aContextName, java.lang.String aParamName, java.lang.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 none
protected java.lang.Class<?> getParameterExpectedValueClass(ConfigurationParameter aParam)
aParam
- configuration parameter declaration information
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |