Class ConfigurationManagerImpl
- java.lang.Object
-
- org.exoplatform.container.configuration.ConfigurationManagerImpl
-
- All Implemented Interfaces:
ConfigurationManager
- Direct Known Subclasses:
MockConfigurationManagerImpl
public class ConfigurationManagerImpl extends Object implements ConfigurationManager
Jul 19, 2004
-
-
Field Summary
Fields Modifier and Type Field Description protected Configurationconfigurations_static StringWAR_CONF_LOCATION-
Fields inherited from interface org.exoplatform.container.configuration.ConfigurationManager
LOG_DEBUG, LOG_DEBUG_PROPERTY
-
-
Constructor Summary
Constructors Constructor Description ConfigurationManagerImpl()ConfigurationManagerImpl(ClassLoader loader, Set<String> profiles)ConfigurationManagerImpl(Set<String> profiles)ConfigurationManagerImpl(Set<String> profiles, boolean logEnabled)ConfigurationManagerImpl(javax.servlet.ServletContext context, Set<String> profiles)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConfiguration(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 addvoidaddConfiguration(javax.servlet.ServletContext context, String url)ComponentgetComponent(Class<?> clazz)Gives the component configuration of a given serviceComponentgetComponent(String service)Gives the component configuration of a given serviceCollection<Component>getComponents()Gives the configuration of all the registered componentsConfigurationgetConfiguration()Gives the entire configurationstatic URLgetCurrentURL()Returns the URL of the current document being unmarshalled or null.InputStreamgetInputStream(String uri)Gives theInputStreamof the resource file corresponding to the url provided in String formatInputStreamgetInputStream(String url, String defaultURL)Gives theInputStreamof the resource file corresponding to the url provided in String formatSet<String>getProfiles()URLgetResource(String uri)Gives theURLof the resource file corresponding to the url provided in String formatURLgetResource(String url, String defaultURL)Gives theURLof the resource file corresponding to the url provided in String formatURLgetURL(String url)This method is equivalent toConfigurationManager.getResource(String)booleanisValidateSchema()voidprocessRemoveConfiguration()protected StringremovePrefix(String prefix, String url)voidsetValidateSchema(boolean validateSchema)
-
-
-
Field Detail
-
WAR_CONF_LOCATION
public static final String WAR_CONF_LOCATION
- See Also:
- Constant Field Values
-
configurations_
protected Configuration configurations_
-
-
Constructor Detail
-
ConfigurationManagerImpl
public ConfigurationManagerImpl()
-
ConfigurationManagerImpl
public ConfigurationManagerImpl(javax.servlet.ServletContext context, Set<String> profiles)
-
ConfigurationManagerImpl
public ConfigurationManagerImpl(ClassLoader loader, Set<String> profiles)
-
-
Method Detail
-
getCurrentURL
public static URL getCurrentURL()
Returns the URL of the current document being unmarshalled or null.- Returns:
- the URL
-
getConfiguration
public Configuration getConfiguration()
Description copied from interface:ConfigurationManagerGives the entire configuration- Specified by:
getConfigurationin interfaceConfigurationManager
-
getProfiles
public Set<String> getProfiles()
- Specified by:
getProfilesin interfaceConfigurationManager- Returns:
- a
Setof profiles used to parse configuration entries
-
addConfiguration
public void addConfiguration(javax.servlet.ServletContext context, String url) throws Exception- Throws:
Exception
-
addConfiguration
public void addConfiguration(String url) throws Exception
Description copied from interface:ConfigurationManagerAdds a new location of a configuration file- Specified by:
addConfigurationin interfaceConfigurationManager- 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
public void addConfiguration(Collection<URL> urls)
Description copied from interface:ConfigurationManagerAdds a collectionURLcorresponding to the location of the configuration files to add- Specified by:
addConfigurationin interfaceConfigurationManager- Parameters:
urls- the URLs of configuration files to add
-
addConfiguration
public void addConfiguration(URL url)
Description copied from interface:ConfigurationManagerAdds a new location of a configuration file- Specified by:
addConfigurationin interfaceConfigurationManager- Parameters:
url- the url of the configuration to add
-
processRemoveConfiguration
public void processRemoveConfiguration()
-
getComponent
public Component getComponent(String service)
Description copied from interface:ConfigurationManagerGives the component configuration of a given service- Specified by:
getComponentin interfaceConfigurationManager- Parameters:
service- the FQN of the service for which we want the configuration
-
getComponent
public Component getComponent(Class<?> clazz)
Description copied from interface:ConfigurationManagerGives the component configuration of a given service- Specified by:
getComponentin interfaceConfigurationManager- Parameters:
clazz- theClassof the service for which we want the configuration
-
getComponents
public Collection<Component> getComponents()
Description copied from interface:ConfigurationManagerGives the configuration of all the registered components- Specified by:
getComponentsin interfaceConfigurationManager
-
isValidateSchema
public boolean isValidateSchema()
-
setValidateSchema
public void setValidateSchema(boolean validateSchema)
-
getResource
public URL getResource(String url, String defaultURL) throws Exception
Description copied from interface:ConfigurationManagerGives theURLof the resource file corresponding to the url provided in String format- Specified by:
getResourcein interfaceConfigurationManager- Parameters:
url- the url to resolvedefaultURL- The default URL to use in case the parameterurlis null.- Returns:
- The
URLrepresenting the String url to resolve - Throws:
Exception- if the String url could not be resolved
-
getResource
public URL getResource(String uri) throws Exception
Description copied from interface:ConfigurationManagerGives theURLof the resource file corresponding to the url provided in String format- Specified by:
getResourcein interfaceConfigurationManager- Parameters:
uri- the url to resolve- Returns:
- The
URLrepresenting the String url to resolve - Throws:
Exception- if the String url could not be resolved
-
getInputStream
public InputStream getInputStream(String url, String defaultURL) throws Exception
Description copied from interface:ConfigurationManagerGives theInputStreamof the resource file corresponding to the url provided in String format- Specified by:
getInputStreamin interfaceConfigurationManager- 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
public InputStream getInputStream(String uri) throws Exception
Description copied from interface:ConfigurationManagerGives theInputStreamof the resource file corresponding to the url provided in String format- Specified by:
getInputStreamin interfaceConfigurationManager- Parameters:
uri- the url to resolve- Returns:
- The
InputStreamof the resource file - Throws:
Exception- if the String url could not be resolved
-
getURL
public URL getURL(String url) throws Exception
Description copied from interface:ConfigurationManagerThis method is equivalent toConfigurationManager.getResource(String)- Specified by:
getURLin interfaceConfigurationManager- Throws:
Exception
-
-