Package top.focess.qq.core.plugin
Class PluginCoreClassLoader
- java.lang.Object
-
- java.lang.ClassLoader
-
- top.focess.qq.core.plugin.PluginCoreClassLoader
-
public class PluginCoreClassLoader extends ClassLoader
-
-
Field Summary
Fields Modifier and Type Field Description static PluginCoreClassLoaderDEFAULT_CLASS_LOADERstatic List<PluginClassLoader>LOADERS
-
Constructor Summary
Constructors Constructor Description PluginCoreClassLoader(ClassLoader parent)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Class<?>forName(String name)static PlugingetClassLoadedBy(Class<?> clazz)Get the plugin of the loaded classClass<?>loadClass(String name, boolean resolve)-
Methods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findClass, findLibrary, findLoadedClass, findResource, findResource, findResources, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResourceAsStream, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
-
-
-
Field Detail
-
DEFAULT_CLASS_LOADER
public static final PluginCoreClassLoader DEFAULT_CLASS_LOADER
-
LOADERS
public static final List<PluginClassLoader> LOADERS
-
-
Constructor Detail
-
PluginCoreClassLoader
public PluginCoreClassLoader(ClassLoader parent)
-
-
Method Detail
-
forName
public static Class<?> forName(String name) throws ClassNotFoundException
- Throws:
ClassNotFoundException
-
getClassLoadedBy
@Nullable public static Plugin getClassLoadedBy(Class<?> clazz)
Get the plugin of the loaded class- Parameters:
clazz- the class- Returns:
- the target plugin, @null if the class is loaded by default classloader
-
loadClass
public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
- Overrides:
loadClassin classClassLoader- Throws:
ClassNotFoundException
-
-