Interface PaperClassLoaderStorage
 The paper classloader storage is also responsible for storing added ConfiguredPluginClassLoaders into
 PluginClassLoaderGroups, via registerOpenGroup(ConfiguredPluginClassLoader),
 registerSpigotGroup(PluginClassLoader) and registerAccessBackedGroup(ConfiguredPluginClassLoader, ClassLoaderAccess).
 
Groups are differentiated into the global group or plugin owned groups.
- The global group holds all registered class loaders and merely exists to maintain backwards compatibility with spigots legacy classloader handling.
- The plugin groups only contains the classloaders that each plugin has access to and hence serves to properly separates unrelated classloaders.
- 
Method SummaryModifier and TypeMethodDescriptionstatic PaperClassLoaderStorageinstance()Access to the shared instance of thePaperClassLoaderStorageAccess.registerAccessBackedGroup(ConfiguredPluginClassLoader classLoader, ClassLoaderAccess access) Registers a paper configured classloader into a new, access backed group.registerOpenGroup(ConfiguredPluginClassLoader classLoader) Registers a paper configured plugin classloader into a new open group, with full access to the global plugin class loader group.registerSpigotGroup(PluginClassLoader pluginClassLoader) Registers a legacy spigotPluginClassLoaderinto the loader storage, creating a group wrapping the single plugin class loader with transitive access to the global group.booleanregisterUnsafePlugin(ConfiguredPluginClassLoader pluginLoader) Registers a configured plugin class loader directly into the global group without adding it to any existing groups.voidunregisterClassloader(ConfiguredPluginClassLoader configuredPluginClassLoader) Unregisters a configured class loader from this storage.
- 
Method Details- 
instanceAccess to the shared instance of thePaperClassLoaderStorageAccess.- Returns:
- the singleton instance of the PaperClassLoaderStorageused throughout the server
 
- 
registerSpigotGroupRegisters a legacy spigotPluginClassLoaderinto the loader storage, creating a group wrapping the single plugin class loader with transitive access to the global group.- Parameters:
- pluginClassLoader- the legacy spigot plugin class loader to register
- Returns:
- the group the plugin class loader was placed into
 
- 
registerOpenGroupRegisters a paper configured plugin classloader into a new open group, with full access to the global plugin class loader group.This method hence allows the configured plugin class loader to access all other class loaders registered in this storage. - Parameters:
- classLoader- the configured plugin class loader to register
- Returns:
- the group the plugin class loader was placed into
 
- 
registerAccessBackedGroupPluginClassLoaderGroup registerAccessBackedGroup(ConfiguredPluginClassLoader classLoader, ClassLoaderAccess access) Registers a paper configured classloader into a new, access backed group. The access backed classloader group, different from an open group, only has access to the classloaders the passedClassLoaderAccessgrants access to.- Parameters:
- classLoader- the configured plugin class loader to register
- access- the class loader access that defines what other classloaders the passed plugin class loader should be granted access to.
- Returns:
- the group the plugin class loader was placed into.
 
- 
unregisterClassloaderUnregisters a configured class loader from this storage. This removes the passed class loaders from any group it may have been a part of, including the global group.Note: this method is highly discouraged from being used, as mutation of the classloaders at runtime is not encouraged - Parameters:
- configuredPluginClassLoader- the class loader to remove from this storage.
 
- 
registerUnsafePluginRegisters a configured plugin class loader directly into the global group without adding it to any existing groups.Note: this method unsafely injects the plugin classloader directly into the global group, which bypasses the group structure paper's plugin API introduced. This method should hence be used with caution. - Parameters:
- pluginLoader- the configured plugin classloader instance that should be registered directly into the global group.
- Returns:
- a simple boolean flag, trueif the classloader was registered orfalseif the classloader was already part of the global group.
 
 
-