Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.hivemind.internal
Interface RegistryInfrastructure  view RegistryInfrastructure download RegistryInfrastructure.java

All Superinterfaces:
org.apache.hivemind.SymbolSource

public interface RegistryInfrastructure
extends org.apache.hivemind.SymbolSource

Extension of org.apache.hivemind.Registry provided by some internals of HiveMind to faciliate the creation of services and configurations.


Method Summary
 void cleanupThread()
          Convienience for invoking org.apache.hivemind.service.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, org.apache.hivemind.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 java.util.Map.
 ConfigurationPoint getConfigurationPoint(java.lang.String configurationId, Module module)
          Returns the configuration point.
 org.apache.hivemind.ErrorHandler getErrorHander()
          Returns the org.apache.hivemind.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.
 org.apache.hivemind.schema.Translator getTranslator(java.lang.String constructor)
          Gets a org.apache.hivemind.schema.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 org.apache.hivemind.events.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

getService

public java.lang.Object getService(java.lang.String serviceId,
                                   java.lang.Class serviceInterface,
                                   Module module)
Obtains a service from the registry. Typically, what's returned is a proxy, but that's irrelevant to the caller, which simply will invoke methods of the service interface.


getService

public java.lang.Object getService(java.lang.Class serviceInterface,
                                   Module module)
Finds a service that implements the provided interface. Exactly one such service may exist or an exception is thrown.


getConfiguration

public java.util.List getConfiguration(java.lang.String configurationId,
                                       Module module)
Returns the converted items contributed to the configuration point.


isConfigurationMappable

public 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.

Since:
1.1

getConfigurationAsMap

public java.util.Map getConfigurationAsMap(java.lang.String configurationId,
                                           Module module)
Returns the elements of the given configuration point as an unmodifiable java.util.Map. It may be empty, but not null.

Since:
1.1

getConfigurationPoint

public ConfigurationPoint getConfigurationPoint(java.lang.String configurationId,
                                                Module module)
Returns the configuration point.


getServicePoint

public ServicePoint getServicePoint(java.lang.String serviceId,
                                    Module module)
Returns the identified service extension point.


expandSymbols

public java.lang.String expandSymbols(java.lang.String input,
                                      org.apache.hivemind.Location location)
Expands any substitution symbols in the input string, replacing each symbol with the symbols value (if known). If a symbol is unknown, then the symbol is passed through unchanged (complete with the ${ and } delimiters) and an error is logged.


getServiceModelFactory

public ServiceModelFactory getServiceModelFactory(java.lang.String name)
Returns a named service-model factory


getTranslator

public org.apache.hivemind.schema.Translator getTranslator(java.lang.String constructor)
Gets a org.apache.hivemind.schema.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).


getLocale

public java.util.Locale getLocale()
Returns the locale for which the registry was created.


getErrorHander

public org.apache.hivemind.ErrorHandler getErrorHander()
Returns the org.apache.hivemind.ErrorHandler for this Registry.


containsConfiguration

public 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).

Since:
1.1

containsService

public 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.

Since:
1.1

containsService

public 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.

Since:
1.1

startup

public void startup()
Invoked once, just after the registry infrastructure is constructed. One time startup operations occur, including execution of any contributions to hivemind.Startup.

Since:
1.1

shutdown

public void shutdown()
Shuts down the registry; this notifies all org.apache.hivemind.events.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.

Since:
1.1

setupThread

public void setupThread()
To be invoked at the start of each request in a multi-threaded environment. Ensures that the receiving Registry will be used if any service proxies are de-serialized.

Since:
1.1

cleanupThread

public void cleanupThread()
Convienience for invoking org.apache.hivemind.service.ThreadEventNotifier#fireThreadCleanup().

Since:
1.1

getServiceIds

public java.util.List getServiceIds(java.lang.Class serviceInterface)

getModule

public Module getModule(java.lang.String moduleId)
Returns the module with the corresponding module id.