|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.hivemind.impl.RegistryBuilder
Class used to build a Registry
from individual
ModuleDescriptor
. The descriptors
are processed one at a time and the registry is constructed using a single call
to constructRegistry(Locale)
at the end.
A note about threadsafety: The assumption is that a single thread will access the RegistryBuilder
at one time (typically, a startup class within some form of server or application). Code
here and in many of the related classes is divided into construction-time logic
and runtime logic. Runtime logic is synchronized and threadsafe. Construction-time logic
is not threadsafe. Methods such as org.apache.hivemind.impl.RegistryImpl#addModule(Module)
,
org.apache.hivemind.impl.ModuleImpl#addConfigurationPoint(ConfigurationPoint)
,
ConfigurationPointImpl.addContribution(Contribution)
and the like are construction-time. Once the registry is fully constructed, it is not
allowed to invoke those methods (though, at this time, no checks occur).
Runtime methods, such as ModuleImpl.getService(String, Class)
are fully threadsafe.
Field Summary | |
static java.lang.String |
HIVE_MODULE_SDL
The path, within a JAR or the classpath, to the SDL HiveMind module deployment descriptor: META-INF/hivemodule.sdl . |
static java.lang.String |
HIVE_MODULE_XML
The path, within a JAR or the classpath, to the XML HiveMind module deployment descriptor: META-INF/hivemodule.xml . |
Constructor Summary | |
RegistryBuilder()
|
|
RegistryBuilder(ErrorHandler handler)
|
Method Summary | |
static Registry |
constructDefaultRegistry()
Constructs a default registry based on just the modules visible to the thread context class loader (this is sufficient is the majority of cases), and using the default locale. |
Registry |
constructRegistry(java.util.Locale locale)
Invoked after all modules have been added with processModule(ClassResolver, Resource) . |
void |
processModule(ClassResolver resolver,
Resource moduleDescriptorResource)
Parses a module and processes its contents. |
void |
processModule(ModuleDescriptor md)
Processes a parsed HiveMind module descriptor. |
void |
processModules(ClassResolver resolver)
Processes all modules that can be found using the resolver. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String HIVE_MODULE_XML
META-INF/hivemodule.xml
.
public static final java.lang.String HIVE_MODULE_SDL
META-INF/hivemodule.sdl
.
Constructor Detail |
public RegistryBuilder()
public RegistryBuilder(ErrorHandler handler)
Method Detail |
public void processModules(ClassResolver resolver)
public void processModule(ClassResolver resolver, Resource moduleDescriptorResource)
processModules(ClassResolver)
to
parse additional modules that are not in the standard location
(for whatever reason).
public void processModule(ModuleDescriptor md)
constructRegistry(Locale)
.
md
- the parsed module descriptorpublic Registry constructRegistry(java.util.Locale locale)
processModule(ClassResolver, Resource)
.
This first resolves all the contributions, then constructs and returns
the registry.
public static Registry constructDefaultRegistry()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |