public abstract class AbstractScanningModuleRegistry extends AbstractModuleRegistry
Modifier and Type | Field and Description |
---|---|
static String |
ACTIVATION_CLASS_PROPERTY
Name of the (optional) property in pom.xml that identifies the activation/deactivation class
in a Module JAR.
|
protected Map<String,MiniModuleMetaMap> |
theMetas
The set of known ModuleMetas, keyed by artifactId and then by
groupId.
|
DEFAULT_DO_NOT_LOAD_CLASS_PREFIXES, RESOLVE_LOCK, theDoNotLoadClassPrefixes
theSingleton
Modifier | Constructor and Description |
---|---|
protected |
AbstractScanningModuleRegistry(Map<String,MiniModuleMetaMap> metas,
String[] doNotLoadClassPrefixes)
Private constructor, for subclasses only.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
addModuleMeta(ModuleMeta add,
HashMap<String,MiniModuleMetaMap> metas)
Add another ModuleMeta during runtime.
|
protected static void |
addParsedModuleMetasFromDirectories(List<File> dirs,
HashMap<String,MiniModuleMetaMap> result)
Given a list of META-INF directories, determine the ModuleMetas that they contain.
|
protected static void |
addParsedModuleMetasFromJars(List<JarFile> jars,
HashMap<String,MiniModuleMetaMap> result)
Given a list of Jar filenames, parse the JARs and determine the ModuleMetas that they contain.
|
ModuleMeta[] |
determineResolutionCandidates(ModuleRequirement req)
Determine the ModuleMetas that are candidates to resolve a Module dependency, based
on the knowledge of this ModuleRegistry.
|
Set<String> |
nameSet()
Obtain the set of Module names currently contained in the registry.
|
Set<String> |
nameSet(Pattern regex)
Obtain the set of Module names currently contained in the registry that match a
naming pattern.
|
protected static ModuleMeta |
parseMetadataFiles(DocumentBuilderFactory dbf,
JarFile jar,
InputStream pomXmlEntryStream,
InputStream pomPropertiesEntryStream,
InputStream manifestEntryStream,
InputStream pomFileStream)
Helper method to parse metadata jar file entries into a ModuleMeta.
|
protected static String |
replaceProperties(HashMap<String,String> prop,
String s)
Replace properties in Strings.
|
static int |
rpmvercmp(String a,
String b)
Helper method to compare two versions the way RPM does it.
|
addModuleRegistryListener, createClassLoader, determineRuntimeDependencies, determineRuntimeUses, determineSingleResolutionCandidate, fireModuleAddedEvent, getResolutionOf, removeModuleRegistryListener, resolve, resolve, toString
getSingleton
protected final Map<String,MiniModuleMetaMap> theMetas
public static final String ACTIVATION_CLASS_PROPERTY
protected AbstractScanningModuleRegistry(Map<String,MiniModuleMetaMap> metas, String[] doNotLoadClassPrefixes)
metas
- the ModuleMetas found, keyed by their artifactId, then by their groupId,
and then ordered by versiondoNotLoadClassPrefixes
- prefixes of classes always to be loaded through the system class loader, not this onepublic ModuleMeta[] determineResolutionCandidates(ModuleRequirement req)
determineResolutionCandidates
in class ModuleRegistry
req
- the ModuleRequirement that we attempt to resolveprotected static void addModuleMeta(ModuleMeta add, HashMap<String,MiniModuleMetaMap> metas)
add
- the ModuleMeta to be addedmetas
- the existing ModuleMetaspublic Set<String> nameSet()
nameSet
in class ModuleRegistry
public Set<String> nameSet(Pattern regex)
nameSet
in class ModuleRegistry
regex
- the regular expressionprotected static void addParsedModuleMetasFromJars(List<JarFile> jars, HashMap<String,MiniModuleMetaMap> result)
jars
- the JarFiles to parseresult
- the hash to add results toprotected static void addParsedModuleMetasFromDirectories(List<File> dirs, HashMap<String,MiniModuleMetaMap> result)
dirs
- the META-INF directoriesresult
- the hash to add the results toprotected static ModuleMeta parseMetadataFiles(DocumentBuilderFactory dbf, JarFile jar, InputStream pomXmlEntryStream, InputStream pomPropertiesEntryStream, InputStream manifestEntryStream, InputStream pomFileStream) throws ParserConfigurationException, IOException, SAXException
dbf
- the XML parser factoryjar
- the JAR file containing the entriespomXmlEntryStream
- reading the maven pom.xml filepomPropertiesEntryStream
- reading the maven pom.properties file (if any)manifestEntryStream
- reading the MANIFEST.MF filepomFileStream
- read the POM from this stream, if given, otherwise use what's inside the JARParserConfigurationException
- misconfigured XML parserIOException
- I/O errorSAXException
- XML syntax errorprotected static String replaceProperties(HashMap<String,String> prop, String s)
prop
- the map of propertiess
- the StringCopyright © 2018. All rights reserved.