|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.hivemind.impl.RegistryBuilder
public final class RegistryBuilder
Class used to build a Registry
from individual
ModuleDescriptor
. The descriptors are provided by the
ModuleDescriptorProvider
parameter passed to constructRegistry(Locale)
method.
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. 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.
Constructor Summary | |
---|---|
RegistryBuilder()
|
|
RegistryBuilder(ErrorHandler handler)
|
Method Summary | |
---|---|
void |
addDefaultModuleDescriptorProvider()
Adds a default module descriptor provider to this RegistryBuilder . |
void |
addModuleDescriptorProvider(ModuleDescriptorProvider provider)
Adds a ModuleDescriptorProvider as a source for
module descriptors to this RegistryBuilder. |
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)
This first loads all modules provided by the ModuleDescriptorProvider, then resolves all the contributions, then constructs and returns the Registry. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RegistryBuilder()
public RegistryBuilder(ErrorHandler handler)
Method Detail |
---|
public void addModuleDescriptorProvider(ModuleDescriptorProvider provider)
ModuleDescriptorProvider
as a source for
module descriptors
to this RegistryBuilder. Adding the same provider
instance multiple times has no effect.
public Registry constructRegistry(java.util.Locale locale)
public void addDefaultModuleDescriptorProvider()
RegistryBuilder
. A default
module descriptor provider is merely a XmlModuleDescriptorProvider
constructed with a
DefaultClassResolver
.
public static Registry constructDefaultRegistry()
addDefaultModuleDescriptorProvider()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |