public class RegistryImpl extends java.lang.Object implements Registry
Registry that delegates to an instance of
RegistryInfrastructure.| Constructor and Description |
|---|
RegistryImpl(RegistryInfrastructure infrastructure) |
| Modifier and Type | Method and Description |
|---|---|
void |
cleanupThread()
Convienience for invoking
ThreadEventNotifier.fireThreadCleanup(). |
boolean |
containsConfiguration(java.lang.String configurationId)
Returns true if a configuration for the specified id exists.
|
boolean |
containsService(java.lang.Class serviceInterface)
Returns true if a single service for the specified service interface class exists.
|
boolean |
containsService(java.lang.String serviceId,
java.lang.Class serviceInterface)
Returns true if a service for the specified service id and service interface exists.
|
java.lang.String |
expandSymbols(java.lang.String input,
Location location)
Expands any substitution symbols in the input string, replacing each symbol with the symbols
value (if known).
|
java.util.List |
getConfiguration(java.lang.String configurationId)
Returns a configuration as a List of elements (as defined by the schema for the configuration
point, or as
Elements if no configuration point does not define
a schema. |
java.util.Map |
getConfigurationAsMap(java.lang.String configurationId)
Returns the elements of the given configuration point as an unmodifiable
Map. |
java.util.Locale |
getLocale()
Returns the locale for which the registry was created.
|
Messages |
getModuleMessages(java.lang.String moduleId)
Returns the Messages object for the specified module.
|
java.lang.Object |
getService(java.lang.Class serviceInterface)
Convenience method to obtain a service with a single implementation from the registry.
|
java.lang.Object |
getService(java.lang.String serviceId,
java.lang.Class serviceInterface)
Obtains a service from the registry.
|
java.util.List |
getServiceIds(java.lang.Class serviceInterface)
Returns a list of service ids for service points which implement the desired service
interface.
|
boolean |
isConfigurationMappable(java.lang.String configurationId)
Returns true if the elements contributed to the given configuration point can be
retrieved as a Map. |
void |
setupThread()
To be invoked at the start of each request in a multi-threaded environment.
|
void |
shutdown()
Shuts down the registry; this notifies all
RegistryShutdownListener services and objects. |
java.lang.String |
valueForSymbol(java.lang.String name)
Returns the value for the symbol, if this source can provide one.
|
public RegistryImpl(RegistryInfrastructure infrastructure)
public boolean containsConfiguration(java.lang.String configurationId)
RegistrycontainsConfiguration in interface Registrypublic boolean containsService(java.lang.Class serviceInterface)
RegistrycontainsService in interface Registrypublic boolean containsService(java.lang.String serviceId, java.lang.Class serviceInterface)
RegistrycontainsService in interface Registrypublic java.util.List getConfiguration(java.lang.String configurationId)
RegistryElements if no configuration point does not define
a schema.getConfiguration in interface RegistryconfigurationId - the fully qualified id of the configuration to obtainpublic boolean isConfigurationMappable(java.lang.String configurationId)
Registryretrieved as a Map.isConfigurationMappable in interface RegistryconfigurationId - the fully qualified id of the configurationModule.isConfigurationMappable(String)public java.util.Map getConfigurationAsMap(java.lang.String configurationId)
RegistryMap. It may
be empty, but not null.getConfigurationAsMap in interface RegistryconfigurationId - the fully qualified id of the configurationModule.getConfigurationAsMap(String),
Registry.isConfigurationMappable(String)public java.lang.String expandSymbols(java.lang.String input, Location location)
Registry${ and } delimiters) and an error is logged.expandSymbols in interface Registryinput - input string to be converted, which may (or may not) contain any symbols.location - the location from which the string was obtained, used if an error is logged.public java.lang.Object getService(java.lang.String serviceId, java.lang.Class serviceInterface)
RegistrygetService in interface RegistryserviceId - the fully qualified id of the service to obtainserviceInterface - the class to which the service will be castpublic java.lang.Object getService(java.lang.Class serviceInterface)
RegistrygetService in interface RegistryserviceInterface - the class to which the service will be cast.Registry.getService(String, Class)public java.util.Locale getLocale()
Registrypublic void shutdown()
RegistryRegistryShutdownListener services and objects. Once the
registry is shutdown, it is no longer valid to obtain new services or configurations, or even
use existing services and configurations.public void cleanupThread()
RegistryThreadEventNotifier.fireThreadCleanup().cleanupThread in interface Registrypublic java.lang.String valueForSymbol(java.lang.String name)
SymbolSourcevalueForSymbol in interface SymbolSourcepublic void setupThread()
RegistrysetupThread in interface RegistryServiceSerializationHelper,
ServiceSerializationSupportpublic java.util.List getServiceIds(java.lang.Class serviceInterface)
RegistrygetServiceIds in interface Registrypublic Messages getModuleMessages(java.lang.String moduleId)
RegistrygetModuleMessages in interface RegistrymoduleId - the module id