|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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. |
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. |
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. |
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. |
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 |
public 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 interfacepublic java.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 modulepublic java.util.List getConfiguration(java.lang.String configurationId, Module module)
configurationId
- the fully qualified id of the configuration *module
- 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)public 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)public 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)public 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.public ServiceModelFactory getServiceModelFactory(java.lang.String name)
public 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)public java.util.Locale getLocale()
public ErrorHandler getErrorHander()
ErrorHandler
for this Registry.
public 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
public 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)
public 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)
public void startup()
hivemind.Startup
.
public 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.
public void setupThread()
ServiceSerializationHelper
,
ServiceSerializationSupport
public void cleanupThread()
ThreadEventNotifier.fireThreadCleanup()
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |