public abstract class ModuleRegistry extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static ModuleRegistry |
theSingleton
The singleton instance of this class.
|
| Constructor and Description |
|---|
ModuleRegistry() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addModuleRegistryListener(ModuleRegistryListener newListener)
Add a ModuleRegistry listener to be notified when new Modules become available etc.
|
protected abstract ClassLoader |
createClassLoader(Module module,
ClassLoader parentClassLoader)
ModuleRegistries can also acts as a factory for the Modules' ClassLoaders.
|
abstract ModuleMeta[] |
determineResolutionCandidates(ModuleRequirement req)
Determine the ModuleMetas that are candidates to resolve a Module dependency, based
on the knowledge of this ModuleRegistry.
|
abstract Module[] |
determineRuntimeDependencies(Module theModule)
Given a Module, this allows us to determine which other Modules it depends at
run-time.
|
abstract Module[] |
determineRuntimeUses(Module theModule)
Given a Module, this allows us to determine which other Modules use it at
run-time.
|
abstract ModuleMeta |
determineSingleResolutionCandidate(ModuleRequirement req)
Convenience method to determine the one and only ModuleMeta that is the only candidate to resolve a Module
dependency, based on the knowledge of this ModuleRegistry.
|
abstract Module |
getResolutionOf(ModuleMeta meta)
Determine whether a certain ModuleMeta is resolved already, and if so,
return it.
|
static ModuleRegistry |
getSingleton()
Obtain the singleton instance of this class, or a subclass.
|
abstract Set<String> |
nameSet()
Obtain the set of Module names currently contained in the registry.
|
abstract Set<String> |
nameSet(Pattern regex)
Obtain the set of Module names currently contained in the registry that match a
naming pattern.
|
abstract void |
removeModuleRegistryListener(ModuleRegistryListener oldListener)
Remove a ModuleRegistry listener.
|
abstract Module |
resolve(ModuleMeta meta)
Recursively resolve this ModuleMeta into a Module.
|
abstract Module |
resolve(ModuleMeta meta,
boolean recursive)
Resolve this ModuleMeta into a Module.
|
protected static ModuleRegistry theSingleton
public static ModuleRegistry getSingleton()
public abstract ModuleMeta[] determineResolutionCandidates(ModuleRequirement req)
req - the ModuleRequirement that we attempt to resolvepublic abstract ModuleMeta determineSingleResolutionCandidate(ModuleRequirement req) throws NoModuleResolutionCandidateException, ModuleResolutionCandidateNotUniqueException
req - the ModuleRequirement that we attempt to resolveNoModuleResolutionCandidateException - thrown if no ModuleMeta was foundModuleResolutionCandidateNotUniqueException - thrown if there were more than one ModuleMeta foundpublic abstract Module resolve(ModuleMeta meta) throws ModuleNotFoundException, ModuleResolutionException
meta - the ModuleMeta to resolveModuleNotFoundException - thrown if the Module could not be foundModuleResolutionException - thrown if the Module could not be resolvedpublic abstract Module resolve(ModuleMeta meta, boolean recursive) throws ModuleNotFoundException, ModuleResolutionException
meta - the ModuleMeta to resolverecursive - resolve recursively if set to trueModuleNotFoundException - thrown if the Module could not be foundModuleResolutionException - thrown if the Module could not be resolvedpublic abstract Module getResolutionOf(ModuleMeta meta)
meta - the ModuleMeta whose resolution we checkpublic abstract Module[] determineRuntimeDependencies(Module theModule)
theModule - the Module whose run-time dependencies we want to determinedetermineRuntimeUses(org.diet4j.core.Module)public abstract Module[] determineRuntimeUses(Module theModule)
theModule - the Module whose uses we want to determine at run-timedetermineRuntimeDependencies(org.diet4j.core.Module)protected abstract ClassLoader createClassLoader(Module module, ClassLoader parentClassLoader)
module - the Module for which to create a ClassLoaderparentClassLoader - the ClassLoader to use as the parent ClassLoaderpublic abstract Set<String> nameSet()
public abstract Set<String> nameSet(Pattern regex)
regex - the regular expressionpublic abstract void addModuleRegistryListener(ModuleRegistryListener newListener)
newListener - the new listener to addremoveModuleRegistryListener(org.diet4j.core.ModuleRegistryListener)public abstract void removeModuleRegistryListener(ModuleRegistryListener oldListener)
oldListener - the listener to removeaddModuleRegistryListener(org.diet4j.core.ModuleRegistryListener)Copyright © 2018. All rights reserved.