Class ModuleJarIndex
java.lang.Object
com.ultikits.ultitools.manager.ModuleJarIndex
Which JARs in the modules folder declare which module main class, as the module loader read them
at start-up (#516).
The loader identifies a module JAR by nothing but the main: entry of its
plugin.yml (#548/#549): it reads that entry and loads exactly that class. This index keeps
what it read, per main class, together with the JAR the class was actually loaded from. It is how
an uninstall knows every file on disk that belongs to a loaded module -- including a second copy
whose plugin.yml declares a different name: -- and how the start-up warning about
duplicate copies names all of them. Nothing here reads a class out of an archive.
Thread-safe: written by the start-up scan, read by /upm commands.
- Since:
- 6.3.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionMain class name -> canonical path -> JAR, for every JAR whoseplugin.ymldeclares it.Main class name -> the JAR its class was loaded from. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static StringcanonicalPath(File file) The main classes two or more JARs declare, each with its JARs in file-name order.jarsDeclaring(String mainClass) Every JAR recorded as declaringmainClass, in file-name order.mainClassOf(UltiToolsPlugin module) The main class the loader recorded for a loaded module: the nearest class in its hierarchy that some JAR declares -- the instance may be a subclass of the declared class, as a proxy is.voidRecords thatjar'splugin.ymldeclaresmainClass.voidrecordSupplier(String mainClass, File jar) Records the JAR the classmainClasswas loaded from.supplierOf(String mainClass) The JAR the classmainClasswas loaded from, ornullwhen it is not known.
-
Field Details
-
jarsByMainClass
-
supplierByMainClass
-
-
Constructor Details
-
ModuleJarIndex
public ModuleJarIndex()
-
-
Method Details
-
record
-
recordSupplier
-
jarsDeclaring
-
supplierOf
-
mainClassOf
The main class the loader recorded for a loaded module: the nearest class in its hierarchy that some JAR declares -- the instance may be a subclass of the declared class, as a proxy is. When none is recorded (a module registered from code rather than from the modules folder), the instance's own class name.- Parameters:
module- a loaded module- Returns:
- its main class name
-
duplicates
-
canonicalPath
-