Class RecipeClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.openrewrite.maven.marketplace.RecipeClassLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
A classloader that provides maximum isolation for recipe implementations
while delegating to the parent for OpenRewrite API types that must be shared.
-
Constructor Summary
ConstructorsConstructorDescriptionRecipeClassLoader(URL[] urls, ClassLoader parent) RecipeClassLoader(Path recipeJar, List<Path> classpath) -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassLoaderforScanning(Path recipeJar, List<Path> classpath) Create a standard ClassLoader for the recipe JAR and its dependencies.static URL[]Convert paths to URL array for URLClassLoader.protected Class<?> Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
RecipeClassLoader
-
RecipeClassLoader
-
-
Method Details
-
loadClass
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
getAdditionalParentDelegatedPackages
- Returns:
- List of class/package prefixes to delegate to parent classloader
-
forScanning
Create a standard ClassLoader for the recipe JAR and its dependencies. This is primarily used for scanning operations where ClassGraph needs standard parent delegation. -
getUrls
Convert paths to URL array for URLClassLoader.
-