Package org.bukkit.plugin.java
Class PluginClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
org.bukkit.plugin.java.PluginClassLoader
- All Implemented Interfaces:
Closeable
,AutoCloseable
A ClassLoader for plugins, to allow shared classes across multiple plugins
-
Constructor Summary
ConstructorDescriptionPluginClassLoader(@NotNull JavaPluginLoader loader, @Nullable ClassLoader parent, @NotNull PluginDescriptionFile description, @NotNull File dataFolder, @NotNull File file, @Nullable ClassLoader libraryLoader)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
protected Class<?>
getResource(String name)
getResources(String name)
protected Class<?>
toString()
protected byte[]
transformBytecode(byte[] bytecode)
Methods inherited from class java.net.URLClassLoader
addURL, definePackage, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
Methods 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, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
PluginClassLoader
public PluginClassLoader(@NotNull @NotNull JavaPluginLoader loader, @Nullable @Nullable ClassLoader parent, @NotNull @NotNull PluginDescriptionFile description, @NotNull @NotNull File dataFolder, @NotNull @NotNull File file, @Nullable @Nullable ClassLoader libraryLoader) throws IOException, InvalidPluginException, MalformedURLException
-
-
Method Details
-
getPlugin
-
getResource
- Overrides:
getResource
in classClassLoader
-
getResources
- Overrides:
getResources
in classClassLoader
- Throws:
IOException
-
loadClass
- Overrides:
loadClass
in classClassLoader
- Throws:
ClassNotFoundException
-
findClass
- Overrides:
findClass
in classURLClassLoader
- Throws:
ClassNotFoundException
-
transformBytecode
protected byte[] transformBytecode(byte[] bytecode) -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classURLClassLoader
- Throws:
IOException
-
toString
-