Interface ConfigurationManager
- All Known Implementing Classes:
ConfigurationManagerImpl,MockConfigurationManagerImpl
public interface ConfigurationManager
The
ConfigurationManager is the component allowing to access to the configuration of a given
eXo container. We have one instance of ConfigurationManager per eXo container.
All the url provided in String format can use the next prefixes:
- war: try to find the file using the Servlet Context of your portal.war or any web applications defined as PortalContainerConfigOwner, so for example in case of the portal.war if the URL is war:/conf/common/portlet-container-configuration.xml it will try to get the file from portal.war/WEB-INF/conf/common/portlet-container-configuration.xml.
- jar or classpath: you can use this prefix to find a file that is accessible using the ClassLoader. For example jar:/conf/my-file.xml will be understood as try to find conf/my-file.xml from the ClassLoader.
- file: this prefix will indicate the configuration manager that it needs to interpret the URL as an absolute path. For example file:///path/to/my/file.xml will be understood as an absolute path.
- Without prefixes: it will be understood as a relative path from the parent directory of the last processed configuration file. For example, if the configuration manager is processing the file corresponding to the URL file:///path/to/my/configuration.xml and in this file you import dir/to/foo.xml, the configuration manager will try to get the file from file:///path/to/my/dir/to/foo.xml. Please note that it works also for other prefixes
- Version:
- $Id: ConfigurationManager.java 5799 2006-05-28 17:55:42Z geaz $
- Author:
- Tuan Nguyen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final booleanConstant that indicates whether the logger of the configuration must be in debug more or not.static final StringThe name of the system property that indicates whether the logger of the configuration must be in debug more or not. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConfiguration(String url) Adds a new location of a configuration filevoidaddConfiguration(URL url) Adds a new location of a configuration filevoidaddConfiguration(Collection<URL> urls) Adds a collectionURLcorresponding to the location of the configuration files to addgetComponent(Class<?> clazz) Gives the component configuration of a given servicegetComponent(String service) Gives the component configuration of a given serviceGives the configuration of all the registered componentsGives the entire configurationgetInputStream(String url) Gives theInputStreamof the resource file corresponding to the url provided in String formatgetInputStream(String url, String defaultURL) Gives theInputStreamof the resource file corresponding to the url provided in String formatgetResource(String url) Gives theURLof the resource file corresponding to the url provided in String formatgetResource(String url, String defaultURL) Gives theURLof the resource file corresponding to the url provided in String formatThis method is equivalent togetResource(String)
-
Field Details
-
LOG_DEBUG_PROPERTY
The name of the system property that indicates whether the logger of the configuration must be in debug more or not.- See Also:
-
LOG_DEBUG
static final boolean LOG_DEBUGConstant that indicates whether the logger of the configuration must be in debug more or not.
-
-
Method Details
-
getConfiguration
Configuration getConfiguration()Gives the entire configuration -
getComponent
Gives the component configuration of a given service- Parameters:
service- the FQN of the service for which we want the configuration
-
getComponent
Gives the component configuration of a given service- Parameters:
clazz- theClassof the service for which we want the configuration
-
getComponents
Collection<Component> getComponents()Gives the configuration of all the registered components -
addConfiguration
Adds a new location of a configuration file- Parameters:
url- the url of the configuration to add, that we want to resolve- Throws:
Exception- if the configuration could not be found or the url in String format could not be resolved
-
addConfiguration
Adds a collectionURLcorresponding to the location of the configuration files to add- Parameters:
urls- the URLs of configuration files to add
-
addConfiguration
Adds a new location of a configuration file- Parameters:
url- the url of the configuration to add
-
getResource
Gives theURLof the resource file corresponding to the url provided in String format -
getResource
Gives theURLof the resource file corresponding to the url provided in String format -
getInputStream
Gives theInputStreamof the resource file corresponding to the url provided in String format- Parameters:
url- the url to resolvedefaultURL- The default URL to use in case the parameterurlis null.- Returns:
- The
InputStreamof the resource file - Throws:
Exception- if the String url could not be resolved
-
getInputStream
Gives theInputStreamof the resource file corresponding to the url provided in String format- Parameters:
url- the url to resolve- Returns:
- The
InputStreamof the resource file - Throws:
Exception- if the String url could not be resolved
-
getURL
This method is equivalent togetResource(String)- Throws:
Exception
-
getProfiles
- Returns:
- a
Setof profiles used to parse configuration entries
-