|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface RegistryInfrastructure
Extension of Registry
provided by some internals of HiveMind to
faciliate the creation of services and configurations.
Method Summary | |
---|---|
void |
cleanupThread()
Convienience for invoking ThreadEventNotifier.fireThreadCleanup() . |
boolean |
containsConfiguration(java.lang.String configurationId,
Module module)
Returns true if a configuration for the specified id exists (and is visible to the specified module). |
boolean |
containsService(java.lang.Class serviceInterface,
Module module)
Returns true if a single service exists which implements the specified service interface and is visible to the given module. |
boolean |
containsService(java.lang.String serviceId,
java.lang.Class serviceInterface,
Module module)
Returns true if a single service with the given id exists which implements the specified service interface and is visible to the given module. |
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,
Module module)
Returns the converted items contributed to the configuration point. |
java.util.Map |
getConfigurationAsMap(java.lang.String configurationId,
Module module)
Returns the elements of the given configuration point as an unmodifiable Map . |
ConfigurationPoint |
getConfigurationPoint(java.lang.String configurationId,
Module module)
Returns the configuration point. |
ErrorHandler |
getErrorHander()
Returns the ErrorHandler for this Registry. |
java.util.Locale |
getLocale()
Returns the locale for which the registry was created. |
Module |
getModule(java.lang.String moduleId)
Returns the module with the corresponding module id. |
java.lang.Object |
getService(java.lang.Class serviceInterface,
Module module)
Finds a service that implements the provided interface. |
java.lang.Object |
getService(java.lang.String serviceId,
java.lang.Class serviceInterface,
Module module)
Obtains a service from the registry. |
java.util.List |
getServiceIds(java.lang.Class serviceInterface)
|
ServiceModelFactory |
getServiceModelFactory(java.lang.String name)
Returns a named service-model factory |
ServicePoint |
getServicePoint(java.lang.String serviceId,
Module module)
Returns the identified service extension point. |
Translator |
getTranslator(java.lang.String constructor)
Gets a Translator instance. |
boolean |
isConfigurationMappable(java.lang.String configurationId,
Module module)
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. |
void |
startup()
Invoked once, just after the registry infrastructure is constructed. |
Methods inherited from interface org.apache.hivemind.SymbolSource |
---|
valueForSymbol |
Method Detail |
---|
java.lang.Object getService(java.lang.String serviceId, java.lang.Class serviceInterface, Module module)
serviceId
- the fully qualified id of the service to obtainserviceInterface
- the class to which the service will be castmodule
- the referencing module, used for visibility checks (null means no module, which
requires that the service be public)
ApplicationRuntimeException
- if the service does not exist (or is not visible), or if it can't be cast to the
specified service interfacejava.lang.Object getService(java.lang.Class serviceInterface, Module module)
serviceInterface
- used to locate the servicemodule
- the referencing module, used for visibility checks. If null, then only public
service points will be considered.
ApplicationRuntimeException
- if either 0, or more than 1, service point is visible to the modulejava.util.List getConfiguration(java.lang.String configurationId, Module module)
configurationId
- the fully qualified id of the configurationmodule
- the referencing module, used for visibility checks (null means no module, which
requires that the configuration be public)
ApplicationRuntimeException
- if no such configuration extension point exists (or visible)boolean isConfigurationMappable(java.lang.String configurationId, Module module)
retrieved as a Map
.
configurationId
- the fully qualified id of the configurationmodule
- the referencing module, used for visibility checks (null means no module, which
requires that the configuration be public)
ApplicationRuntimeException
- if no visible configuration point with the given id existsModule.isConfigurationMappable(String)
java.util.Map getConfigurationAsMap(java.lang.String configurationId, Module module)
Map
. It may
be empty, but not null.
configurationId
- the fully qualified id of the configurationmodule
- the referencing module, used for visibility checks (null means no module, which
requires that the configuration be public)
ApplicationRuntimeException
- if no visible configuration point with the given id exists or if the elements
can't be mapped.Module.getConfigurationAsMap(String)
,
#isConfigurationMappable(String)
ConfigurationPoint getConfigurationPoint(java.lang.String configurationId, Module module)
configurationId
- the fully qualified id of the configurationmodule
- the referencing module, used for visibility checks (null means no module, which
requires that the configuration be public)
ApplicationRuntimeException
- if the configurationId does not exist (or is not visible)ServicePoint getServicePoint(java.lang.String serviceId, Module module)
serviceId
- fully qualified id of the service pointmodule
- the referencing module, used for visibility checks (null means no module, which
requires that the service be public)
ApplicationRuntimeException
- if no such service extension point exists (or is visible to the module)java.lang.String expandSymbols(java.lang.String input, Location location)
${
and }
delimiters) and an error is logged.
input
- 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.ServiceModelFactory getServiceModelFactory(java.lang.String name)
Translator getTranslator(java.lang.String constructor)
Translator
instance. The Translator may be a shared, cached instance
(Translators should be stateless). Translators are identified by a constructor, which may be
the name of a translator defined in the hivemind.Translators
extension point
(a single builtin translator, class
, is hardcoded). Alternately, the name may
consist of a translator name, a comma, and an initializer string for the service (example:
int,min=5
).
constructor
- the name and optional initialization of a Translator
Translator
instance
ApplicationRuntimeException
- if the translator can not be constructed (i.e., the name is not known)java.util.Locale getLocale()
ErrorHandler getErrorHander()
ErrorHandler
for this Registry.
boolean containsConfiguration(java.lang.String configurationId, Module module)
configurationId
- to search formodule
- the configuration must be visible to, or null for no module (the application's
view
boolean containsService(java.lang.Class serviceInterface, Module module)
serviceInterface
- module
- the service must be visible to the module (or null for the application's view)
boolean containsService(java.lang.String serviceId, java.lang.Class serviceInterface, Module module)
serviceId
- serviceInterface
- module
- the service must be visible to the module (or null for the application's view)
void startup()
hivemind.Startup
.
void shutdown()
RegistryShutdownListener
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.
void setupThread()
ServiceSerializationHelper
,
ServiceSerializationSupport
void cleanupThread()
ThreadEventNotifier.fireThreadCleanup()
.
java.util.List getServiceIds(java.lang.Class serviceInterface)
serviceInterface
- Module getModule(java.lang.String moduleId)
moduleId
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |