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

Quick Search    Search Deep

org.apache.hivemind
Interface Registry  view Registry download Registry.java

All Superinterfaces:
SymbolSource

public interface Registry
extends SymbolSource

The HiveMind registry; primarily this is used to gain access to services.

In addition, Registry implements SymbolSource which allows programatic access to substitution symbols.


Method Summary
 void cleanupThread()
          Convienience for invoking ThreadEventNotifier.fireThreadCleanup()>ThreadEventNotifier.fireThreadCleanup() 55 .
 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 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)
          Returns a configuration as a List of elements (as defined by the schema for the configuration point, or as Elements if no configuration point does not define a schema.
 java.util.Map getConfigurationAsMap(java.lang.String configurationId)
          Returns the elements of the given configuration point as an unmodifiable java.util.Map.
 java.util.Locale getLocale()
          Returns the locale for which the registry was created.
 Messages getModuleMessages(java.lang.String moduleId)
          Returns the Messages object for the specified module.
 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.
 java.util.List getServiceIds(java.lang.Class serviceInterface)
          Returns a list of service ids for service points which implement the desired service interface.
 boolean isConfigurationMappable(java.lang.String configurationId)
          Returns true if the elements contributed to the given configuration point can be retrieved as a Map 55 .
 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.
 
Methods inherited from interface org.apache.hivemind.SymbolSource
valueForSymbol
 

Method Detail

containsConfiguration

public boolean containsConfiguration(java.lang.String configurationId)
Returns true if a configuration for the specified id exists.


containsService

public boolean containsService(java.lang.Class serviceInterface)
Returns true if a single service for the specified service interface class exists.


containsService

public boolean containsService(java.lang.String serviceId,
                               java.lang.Class serviceInterface)
Returns true if a service for the specified service id and service interface exists.


getConfiguration

public 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 Elements if no configuration point does not define a schema.


isConfigurationMappable

public boolean isConfigurationMappable(java.lang.String configurationId)
Returns true if the elements contributed to the given configuration point can be retrieved as a Map 55 .

Since:
1.1

getConfigurationAsMap

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

Since:
1.1

expandSymbols

public 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). If a symbol is unknown, then the symbol is passed through unchanged (complete with the ${ and } delimiters) and an error is logged.


getService

public java.lang.Object getService(java.lang.String serviceId,
                                   java.lang.Class serviceInterface)
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)
Convenience method to obtain a service with a single implementation from the registry. Exactly one service point must implement the service.


getLocale

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


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.


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 ThreadEventNotifier.fireThreadCleanup()>ThreadEventNotifier.fireThreadCleanup() 55 .


getServiceIds

public java.util.List getServiceIds(java.lang.Class serviceInterface)
Returns a list of service ids for service points which implement the desired service interface.

Since:
1.1

getModuleMessages

public Messages getModuleMessages(java.lang.String moduleId)
Returns the Messages object for the specified module.