|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.hivemind.impl.RegistryImpl
Implementation of Registry
.
Constructor Summary | |
RegistryImpl(ErrorHandler errorHandler,
java.util.Locale locale)
|
Method Summary | |
void |
addConfigurationPoint(ConfigurationPoint point)
|
void |
addServicePoint(ServicePoint point)
|
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 text,
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 Element s if no configuration point
does not define a schema. |
ConfigurationPoint |
getConfigurationPoint(java.lang.String configurationId)
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)
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. |
ServiceModelFactory |
getServiceModelFactory(java.lang.String name)
Returns a named service-model factory |
ServicePoint |
getServicePoint(java.lang.String serviceId)
Returns the identified service extension point. |
Translator |
getTranslator(java.lang.String translator)
Gets a Translator instance. |
void |
setLocale(java.util.Locale locale)
|
void |
setShutdownCoordinator(ShutdownCoordinator coordinator)
|
void |
shutdown()
Invokes ShutdownCoordinator.shutdown() , then releases
the coordinator, modules and variable sources. |
void |
startup()
Starts up the Registry after all service and configuration points have been defined. |
java.lang.String |
toString()
|
java.lang.String |
valueForSymbol(java.lang.String name)
Returns the value for the symbol, if this source can provide one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public RegistryImpl(ErrorHandler errorHandler, java.util.Locale locale)
Method Detail |
public java.util.Locale getLocale()
Registry
getLocale
in interface Registry
public void addServicePoint(ServicePoint point)
public void addConfigurationPoint(ConfigurationPoint point)
public ServicePoint getServicePoint(java.lang.String serviceId)
RegistryInfrastructure
getServicePoint
in interface RegistryInfrastructure
serviceId
- fully qualified id of the service pointpublic java.lang.Object getService(java.lang.String serviceId, java.lang.Class serviceInterface)
Registry
getService
in interface Registry
serviceId
- the fully qualified id of the service to obtainserviceInterface
- the class to which the service will be cast
public java.lang.Object getService(java.lang.Class serviceInterface)
Registry
getService
in interface Registry
serviceInterface
- the class to which the service will be cast.
Registry.getService(String, Class)
public ConfigurationPoint getConfigurationPoint(java.lang.String configurationId)
RegistryInfrastructure
getConfigurationPoint
in interface RegistryInfrastructure
configurationId
- the fully qualified id of the configuration
public java.util.List getConfiguration(java.lang.String configurationId)
Registry
Element
s if no configuration point
does not define a schema.
getConfiguration
in interface Registry
configurationId
- the fully qualified id of the configuration to obtain
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String expandSymbols(java.lang.String text, Location location)
Registry
${
and }
delimiters) and an error is logged.
expandSymbols
in interface Registry
text
- 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.String valueForSymbol(java.lang.String name)
SymbolSource
valueForSymbol
in interface SymbolSource
public void setShutdownCoordinator(ShutdownCoordinator coordinator)
public void shutdown()
ShutdownCoordinator.shutdown()
, then releases
the coordinator, modules and variable sources.
shutdown
in interface Registry
public void startup()
In addition, the service hivemind.Startup
is obtained and
run()
is invoked on it. This allows additional startup, provided
in the hivemind.Startup
configuration point, to be executed.
public ServiceModelFactory getServiceModelFactory(java.lang.String name)
RegistryInfrastructure
getServiceModelFactory
in interface RegistryInfrastructure
public void cleanupThread()
Registry
ThreadEventNotifier.fireThreadCleanup()
.
cleanupThread
in interface Registry
public boolean containsConfiguration(java.lang.String configurationId)
Registry
containsConfiguration
in interface Registry
configurationId
-
public boolean containsService(java.lang.Class serviceInterface)
Registry
containsService
in interface Registry
serviceInterface
-
public boolean containsService(java.lang.String serviceId, java.lang.Class serviceInterface)
Registry
containsService
in interface Registry
serviceId
- serviceInterface
-
public void setLocale(java.util.Locale locale)
public ErrorHandler getErrorHander()
RegistryInfrastructure
ErrorHandler
for this Registry.
getErrorHander
in interface RegistryInfrastructure
public Translator getTranslator(java.lang.String translator)
RegistryInfrastructure
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
).
getTranslator
in interface RegistryInfrastructure
Translator
instance
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |