public final class ConfigurationsProviderManager extends Object
ServiceLoader to load a ConfigurationsProvider.
By default, it configures ServiceLoader to use the current thread's
context class loader. The ConfigurationsProvider is loaded lazily
upon calls to getConfigurations() or
getConfigurationsProvider(). Use
setConfigurationsProviderClassLoader(java.lang.ClassLoader) to specify a different class
loader. The ConfigurationsProvider in turn is used to get
Configurations.
A program can also explicitly set a configurations provider using the
setConfigurationsProvider(org.protempa.backend.ConfigurationsProvider) method. This will override the use of ServiceLoader.| Constructor and Description |
|---|
ConfigurationsProviderManager() |
| Modifier and Type | Method and Description |
|---|---|
static Configurations |
getConfigurations()
Convenience static method for getting configurations, like calling
getConfigurationsProvider() followed by
ConfigurationsProvider.getConfigurations(). |
static ConfigurationsProvider |
getConfigurationsProvider()
Gets the configurations provider found by service discovery or set with
{@link #setConfigurationsProvider(org.protempa.backend.ConfigurationsProvider).
|
static ClassLoader |
getConfigurationsProviderClassLoader() |
static boolean |
isConfigurationsProviderClassLoaderSpecified()
Indicates whether
setConfigurationsProviderClassLoader(java.lang.ClassLoader) has been
called. |
static void |
setConfigurationsProvider(ConfigurationsProvider configurationsProvider)
Sets the configurations provider, overriding any configurations provider
that was found by service discovery.
|
static void |
setConfigurationsProviderClassLoader(ClassLoader loader) |
public static void setConfigurationsProviderClassLoader(ClassLoader loader)
public static ClassLoader getConfigurationsProviderClassLoader()
public static boolean isConfigurationsProviderClassLoaderSpecified()
setConfigurationsProviderClassLoader(java.lang.ClassLoader) has been
called.setConfigurationsProviderClassLoader(java.lang.ClassLoader) has been
called.public static void setConfigurationsProvider(ConfigurationsProvider configurationsProvider)
configurationsProvider - a ConfigurationsProvider.public static ConfigurationsProvider getConfigurationsProvider()
ConfigurationsProvider.public static Configurations getConfigurations()
getConfigurationsProvider() followed by
ConfigurationsProvider.getConfigurations().Configurations instance.Copyright © 2012–2016 Emory University. All rights reserved.