bee
PriorityClassLoader
A ClassLoader that provides fine-grained control over class loading delegation.
- Allows specifying "high-priority" classes loaded child-first from its own URLs.
- Allows specifying "isolated" package prefixes (e.g., "bee.isolated.") whose classes are always loaded by this loader, even if present in the parent. If the class bytecode is not found in this loader's URLs, it attempts to fetch the bytecode from the parent/system and define it within this loader.
- For all other classes, it follows the standard parent-first delegation model.
PriorityClassLoader
(UserInterface
ui
)
UserInterface
ui
)UserInterface ui |
Constructs an empty PriorityClassLoader.
loadClass
(String
name
, boolean
resolve
)
Class?
String
name
, boolean
resolve
)?
String name |
The binary name of the class to load. |
boolean resolve |
If |
Class |
The resulting |
ClassNotFoundException |
Loads the class with the specified binary name according to the priority/isolation rules.
addClassPath
(psychopath.Location
location
)
PriorityClassLoader
psychopath.Location
location
)psychopath.Location location |
The location to be added (your custom type). |
PriorityClassLoader |
This |
Adds the specified location (JAR file or class directory) to the classpath.
Uses the custom Location
type.
importAsPriorityClass
(Class?
target
)
PriorityClassLoader
Class?
target
)Class target |
The target class to be defined with high priority. |
PriorityClassLoader |
This |
Defines and potentially loads the specified class with high priority.
The class bytecode is retrieved as a resource using the system class loader. The class name is added to the high-priority set. This method attempts to define the class within this class loader.