|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Module
The definition of a HiveMind Module. A Module is a container of service extension points and configuration extension points. It also acts as a "gateway" so that services and configurations in other modules may be accessed.
Why do we expose the Module rather than the
RegistryInfrastructure
? It's more than just qualifying ids
before passing them up to the RI. At some future point, a concept of visibility will be added to
HiveMind. This will make many services and configurations private to the module which defines
them and the necessary visibility filtering logic will be here.
Method Summary | |
---|---|
boolean |
containsService(java.lang.Class serviceInterface)
Returns true if a single service exists which implements the specified service interface and is visible to this module. |
java.lang.String |
expandSymbols(java.lang.String input,
Location location)
|
ClassResolver |
getClassResolver()
Returns the resource resolver for this module. |
java.util.List |
getConfiguration(java.lang.String configurationId)
Returns the List of elements for the specified configuration point. |
java.util.Map |
getConfigurationAsMap(java.lang.String configurationId)
Returns the elements of the given configuration point as an unmodifiable Map . |
ErrorHandler |
getErrorHandler()
Returns the ErrorHandler for this Registry. |
java.util.Locale |
getLocale()
|
Messages |
getMessages()
Returns an object that can provide and format localized messages for this module. |
java.lang.String |
getModuleId()
Returns the unique identifier for this module. |
java.lang.Object |
getService(java.lang.Class serviceInterface)
Finds a service that implements the provided interface. |
java.lang.Object |
getService(java.lang.String serviceId,
java.lang.Class serviceInterface)
Looks up the ServicePoint (throwing an exception if not found) and invokes
ServicePoint.getService(Class) . |
ServiceModelFactory |
getServiceModelFactory(java.lang.String name)
|
ServicePoint |
getServicePoint(java.lang.String serviceId)
Returns the identified service extension point. |
Translator |
getTranslator(java.lang.String translator)
|
boolean |
isConfigurationMappable(java.lang.String configurationId)
Returns true if the elements contributed to the given configuration point can be retrieved as a Map . |
java.lang.Class |
resolveType(java.lang.String type)
Returns the class matching the type. |
Methods inherited from interface org.apache.hivemind.Locatable |
---|
getLocation |
Methods inherited from interface org.apache.hivemind.SymbolSource |
---|
valueForSymbol |
Method Detail |
---|
java.lang.String getModuleId()
boolean containsService(java.lang.Class serviceInterface)
serviceInterface
-
java.lang.Object getService(java.lang.String serviceId, java.lang.Class serviceInterface)
ServicePoint
(throwing an exception if not found) and invokes
ServicePoint.getService(Class)
.
serviceId
- an unqualified id for a service within this module, or a fully qualified id for a
service in this or any other moduleserviceInterface
- type the result will be cast tojava.lang.Object getService(java.lang.Class serviceInterface)
serviceInterface
- used to locate the serviceServicePoint getServicePoint(java.lang.String serviceId)
serviceId
- an unqualified id for a service within this module, or a fully qualified id for a
service in this or any other module
ApplicationRuntimeException
- if no such service extension point existsjava.util.List getConfiguration(java.lang.String configurationId)
List
of elements for the specified configuration point. The
returned List is unmodifiable. It may be empty, but won't be null.
It is expressly the caller's job to sort the elements into an appropriate order (a copy will have to be made since the returned List is unmodifiable).
configurationId
- an unqualified id for a configuration within this module, or a fully qualified id
for a configuration in this or any other module
ApplicationRuntimeException
- if this module does not contain the specified configuration extension point.boolean isConfigurationMappable(java.lang.String configurationId)
retrieved as a Map
.
ConfigurationPoint.areElementsMappable()
java.util.Map getConfigurationAsMap(java.lang.String configurationId)
Map
. It may
be empty, but not null.
configurationId
- an unqualified id for a configuration within this module, or a fully qualified id
for a configuration in this or any other module.
ApplicationRuntimeException
- if no configuration point with the given id exists or if the elements can't be
mapped.ConfigurationPoint.getElementsAsMap()
,
isConfigurationMappable(String)
ClassResolver getClassResolver()
java.lang.Class resolveType(java.lang.String type)
type
- the Java type to convert into a class. May be a primitive type, or an array of
objects or primitives.
Class
object.
ApplicationRuntimeException
- if the type may not be converted into a Class.Messages getMessages()
hivemodule.properties
(localized) stored
with the HiveMind deployment descriptor in the META-INF folder.
Translator getTranslator(java.lang.String translator)
RegistryInfrastructure.getTranslator(String)
ServiceModelFactory getServiceModelFactory(java.lang.String name)
RegistryInfrastructure.getServiceModelFactory(String)
java.util.Locale getLocale()
Registry.getLocale()
java.lang.String expandSymbols(java.lang.String input, Location location)
RegistryInfrastructure.expandSymbols(String, Location)
ErrorHandler getErrorHandler()
ErrorHandler
for this Registry.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |