|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hivemind.impl.RegistryInfrastructureImpl
public final class RegistryInfrastructureImpl
Implementation of RegistryInfrastructure
.
Constructor Summary | |
---|---|
RegistryInfrastructureImpl(ErrorHandler errorHandler,
java.util.Locale locale)
|
Method Summary | |
---|---|
void |
addConfigurationPoint(ConfigurationPoint point)
|
void |
addModule(Module module)
|
void |
addServicePoint(ServicePoint point)
|
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.Object |
getConfiguration(java.lang.Class configurationType,
Module module)
Finds a configuration of the specified type. |
java.lang.Object |
getConfiguration(java.lang.String configurationId,
Module module)
Returns the specified configuration. |
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.lang.Object |
getServiceFromToken(ServiceToken token)
Returns the service (proxy) for the indicated token. |
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. |
ServiceToken |
getServiceTokenForService(java.lang.String serviceId)
Returns a ServiceToken corresponding to the indicated serviceId. |
void |
setShutdownCoordinator(ShutdownCoordinator coordinator)
|
void |
setupThread()
Sets the current RI up as the ServiceSerializationSupport. |
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()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RegistryInfrastructureImpl(ErrorHandler errorHandler, java.util.Locale locale)
Method Detail |
---|
public java.util.Locale getLocale()
RegistryInfrastructure
getLocale
in interface RegistryInfrastructure
public void addModule(Module module)
public void addServicePoint(ServicePoint point)
public void addConfigurationPoint(ConfigurationPoint point)
public ServicePoint getServicePoint(java.lang.String serviceId, Module module)
RegistryInfrastructure
getServicePoint
in interface RegistryInfrastructure
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)RegistryInfrastructure.getServicePoint(java.lang.String, org.apache.hivemind.internal.Module)
public java.lang.Object getService(java.lang.String serviceId, java.lang.Class serviceInterface, Module module)
RegistryInfrastructure
getService
in interface RegistryInfrastructure
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)
public java.lang.Object getService(java.lang.Class serviceInterface, Module module)
RegistryInfrastructure
getService
in interface RegistryInfrastructure
serviceInterface
- used to locate the servicemodule
- the referencing module, used for visibility checks. If null, then only public
service points will be considered.public ConfigurationPoint getConfigurationPoint(java.lang.String configurationId, Module module)
RegistryInfrastructure
getConfigurationPoint
in interface RegistryInfrastructure
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)
public java.lang.Object getConfiguration(java.lang.String configurationId, Module module)
RegistryInfrastructure
getConfiguration
in interface RegistryInfrastructure
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)
public java.lang.Object getConfiguration(java.lang.Class configurationType, Module module)
RegistryInfrastructure
getConfiguration
in interface RegistryInfrastructure
configurationType
- the configuration typemodule
- the referencing module, used for visibility checks (null means no module, which
requires that the configuration be public)
RegistryInfrastructure.getConfiguration(java.lang.Class, org.apache.hivemind.internal.Module)
public java.lang.String toString()
toString
in class java.lang.Object
public void setShutdownCoordinator(ShutdownCoordinator coordinator)
public void shutdown()
ShutdownCoordinator.shutdown()
, then releases the coordinator, modules and
variable sources.
shutdown
in interface RegistryInfrastructure
public void startup()
This instance is stored into
ServiceSerializationHelper.setServiceSerializationSupport(ServiceSerializationSupport)
.
This may cause errors (and incorrect behavior) if multiple Registries exist in a single JVM.
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.
startup
in interface RegistryInfrastructure
public ServiceModelFactory getServiceModelFactory(java.lang.String name)
RegistryInfrastructure
getServiceModelFactory
in interface RegistryInfrastructure
public void cleanupThread()
RegistryInfrastructure
ThreadEventNotifier.fireThreadCleanup()
.
cleanupThread
in interface RegistryInfrastructure
public boolean containsConfiguration(java.lang.String configurationId, Module module)
RegistryInfrastructure
containsConfiguration
in interface RegistryInfrastructure
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)
RegistryInfrastructure
containsService
in interface RegistryInfrastructure
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)
RegistryInfrastructure
containsService
in interface RegistryInfrastructure
module
- the service must be visible to the module (or null for the application's view)
public ErrorHandler getErrorHander()
RegistryInfrastructure
ErrorHandler
for this Registry.
getErrorHander
in interface RegistryInfrastructure
public java.lang.Object getServiceFromToken(ServiceToken token)
ServiceSerializationSupport
getServiceFromToken
in interface ServiceSerializationSupport
public ServiceToken getServiceTokenForService(java.lang.String serviceId)
ServiceSerializationSupport
ServiceToken
corresponding to the indicated serviceId. A ServiceToken takes
the place of a service (proxy) during serialization.
getServiceTokenForService
in interface ServiceSerializationSupport
public void setupThread()
setupThread
in interface RegistryInfrastructure
ServiceSerializationHelper
,
ServiceSerializationSupport
public Module getModule(java.lang.String moduleId)
RegistryInfrastructure
getModule
in interface RegistryInfrastructure
public java.util.List getServiceIds(java.lang.Class serviceInterface)
getServiceIds
in interface RegistryInfrastructure
RegistryInfrastructure.getServiceIds(java.lang.Class)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |