public class ConfigurationManagerImpl extends Object implements ConfigurationManager
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
configurations_ |
static String |
WAR_CONF_LOCATION |
LOG_DEBUG, LOG_DEBUG_PROPERTY| Constructor and Description |
|---|
ConfigurationManagerImpl() |
ConfigurationManagerImpl(ClassLoader loader,
Set<String> profiles) |
ConfigurationManagerImpl(javax.servlet.ServletContext context,
Set<String> profiles) |
ConfigurationManagerImpl(Set<String> profiles) |
ConfigurationManagerImpl(Set<String> profiles,
boolean logEnabled) |
| Modifier and Type | Method and Description |
|---|---|
void |
addConfiguration(Collection<URL> urls)
Adds a collection
URL corresponding to the location of the
configuration files to add |
void |
addConfiguration(javax.servlet.ServletContext context,
String url) |
void |
addConfiguration(String url)
Adds a new location of a configuration file
|
void |
addConfiguration(URL url)
Adds a new location of a configuration file
|
Component |
getComponent(Class<?> clazz)
Gives the component configuration of a given service
|
Component |
getComponent(String service)
Gives the component configuration of a given service
|
Collection<Component> |
getComponents()
Gives the configuration of all the registered components
|
Configuration |
getConfiguration()
Gives the entire configuration
|
static URL |
getCurrentURL()
Returns the URL of the current document being unmarshalled or null.
|
InputStream |
getInputStream(String uri)
Gives the
InputStream of the resource file corresponding to the url provided in
String format |
InputStream |
getInputStream(String url,
String defaultURL)
Gives the
InputStream of the resource file corresponding to the url provided in
String format |
URL |
getResource(String uri)
Gives the
URL of the resource file corresponding to the url provided in
String format |
URL |
getResource(String url,
String defaultURL)
Gives the
URL of the resource file corresponding to the url provided in
String format |
URL |
getURL(String url)
This method is equivalent to
ConfigurationManager.getResource(String) |
boolean |
isValidateSchema() |
void |
processRemoveConfiguration() |
protected String |
removePrefix(String prefix,
String url) |
void |
setValidateSchema(boolean validateSchema) |
public static final String WAR_CONF_LOCATION
protected Configuration configurations_
public ConfigurationManagerImpl()
public ConfigurationManagerImpl(javax.servlet.ServletContext context,
Set<String> profiles)
public ConfigurationManagerImpl(ClassLoader loader, Set<String> profiles)
public static URL getCurrentURL()
public Configuration getConfiguration()
ConfigurationManagergetConfiguration in interface ConfigurationManagerpublic void addConfiguration(javax.servlet.ServletContext context,
String url)
throws Exception
Exceptionpublic void addConfiguration(String url) throws Exception
ConfigurationManageraddConfiguration in interface ConfigurationManagerurl - the url of the configuration to add, that we want to resolveException - if the configuration could not be found
or the url in String format could not be resolvedpublic void addConfiguration(Collection<URL> urls)
ConfigurationManagerURL corresponding to the location of the
configuration files to addaddConfiguration in interface ConfigurationManagerurls - the URLs of configuration files to addpublic void addConfiguration(URL url)
ConfigurationManageraddConfiguration in interface ConfigurationManagerurl - the url of the configuration to addpublic void processRemoveConfiguration()
public Component getComponent(String service)
ConfigurationManagergetComponent in interface ConfigurationManagerservice - the FQN of the service for which we want the configurationpublic Component getComponent(Class<?> clazz)
ConfigurationManagergetComponent in interface ConfigurationManagerclazz - the Class of the service for which we want the configurationpublic Collection<Component> getComponents()
ConfigurationManagergetComponents in interface ConfigurationManagerpublic boolean isValidateSchema()
public void setValidateSchema(boolean validateSchema)
public URL getResource(String url, String defaultURL) throws Exception
ConfigurationManagerURL of the resource file corresponding to the url provided in
String formatgetResource in interface ConfigurationManagerurl - the url to resolvedefaultURL - The default URL to use in case the parameter url is null.URL representing the String url to resolveException - if the String url could not be resolvedpublic URL getResource(String uri) throws Exception
ConfigurationManagerURL of the resource file corresponding to the url provided in
String formatgetResource in interface ConfigurationManageruri - the url to resolveURL representing the String url to resolveException - if the String url could not be resolvedpublic InputStream getInputStream(String url, String defaultURL) throws Exception
ConfigurationManagerInputStream of the resource file corresponding to the url provided in
String formatgetInputStream in interface ConfigurationManagerurl - the url to resolvedefaultURL - The default URL to use in case the parameter url is null.InputStream of the resource fileException - if the String url could not be resolvedpublic InputStream getInputStream(String uri) throws Exception
ConfigurationManagerInputStream of the resource file corresponding to the url provided in
String formatgetInputStream in interface ConfigurationManageruri - the url to resolveInputStream of the resource fileException - if the String url could not be resolvedpublic URL getURL(String url) throws Exception
ConfigurationManagerConfigurationManager.getResource(String)getURL in interface ConfigurationManagerExceptionCopyright © 2017 eXo Platform SAS. All Rights Reserved.