Package xyz.srnyx.annoyingapi.library
Class AnnoyingLibraryManager
- java.lang.Object
-
- net.byteflux.libby.LibraryManager
-
- net.byteflux.libby.BukkitLibraryManager
-
- xyz.srnyx.annoyingapi.library.AnnoyingLibraryManager
-
- All Implemented Interfaces:
Annoyable
public class AnnoyingLibraryManager extends net.byteflux.libby.BukkitLibraryManager implements Annoyable
A library manager that can load libraries into the server's classpath or into an isolated classloader usingRuntimeLibrary
-
-
Constructor Summary
Constructors Constructor Description AnnoyingLibraryManager(@NotNull AnnoyingPlugin plugin)Create a newAnnoyingLibraryManagerfor the pluginAnnoyingLibraryManager(@NotNull AnnoyingPlugin plugin, @NotNull java.lang.String directoryName)Create a newAnnoyingLibraryManagerfor the plugin with a custom directory name
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull AnnoyingPlugingetAnnoyingPlugin()TheAnnoyingPlugininstance@NotNull java.util.Optional<net.byteflux.libby.classloader.IsolatedClassLoader>getIsolatedClassLoaderOf(@NotNull RuntimeLibrary library)Get theIsolatedClassLoaderof aRuntimeLibrarybooleanisLoaded(@NotNull RuntimeLibrary library)Check if aRuntimeLibraryis loaded in the server's classpathbooleanisLoadedIsolated(@NotNull RuntimeLibrary library)Check if aRuntimeLibraryis loaded in an isolated classloadervoidloadLibrary(@NotNull RuntimeLibrary library)Load aRuntimeLibraryinto the server's classpath@NotNull net.byteflux.libby.classloader.IsolatedClassLoaderloadLibraryIsolated(@NotNull RuntimeLibrary library)Load aRuntimeLibraryinto an isolated classloader
-
-
-
Constructor Detail
-
AnnoyingLibraryManager
public AnnoyingLibraryManager(@NotNull @NotNull AnnoyingPlugin plugin)Create a newAnnoyingLibraryManagerfor the plugin- Parameters:
plugin-plugin
-
AnnoyingLibraryManager
public AnnoyingLibraryManager(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull java.lang.String directoryName)Create a newAnnoyingLibraryManagerfor the plugin with a custom directory name- Parameters:
plugin-plugindirectoryName- the name of the directory to store the libraries in
-
-
Method Detail
-
getAnnoyingPlugin
@NotNull public @NotNull AnnoyingPlugin getAnnoyingPlugin()
Description copied from interface:AnnoyableTheAnnoyingPlugininstance- Specified by:
getAnnoyingPluginin interfaceAnnoyable- Returns:
- the plugin instance
-
loadLibrary
public void loadLibrary(@NotNull @NotNull RuntimeLibrary library)Load aRuntimeLibraryinto the server's classpath- Parameters:
library- the library to load- See Also:
loadLibraryIsolated(RuntimeLibrary)
-
loadLibraryIsolated
@NotNull public @NotNull net.byteflux.libby.classloader.IsolatedClassLoader loadLibraryIsolated(@NotNull @NotNull RuntimeLibrary library)Load aRuntimeLibraryinto an isolated classloader- Parameters:
library- the library to load- Returns:
- the isolated classloader containing the library
- See Also:
loadLibrary(RuntimeLibrary)
-
getIsolatedClassLoaderOf
@NotNull public @NotNull java.util.Optional<net.byteflux.libby.classloader.IsolatedClassLoader> getIsolatedClassLoaderOf(@NotNull @NotNull RuntimeLibrary library)Get theIsolatedClassLoaderof aRuntimeLibrary- Parameters:
library- the library to get the classloader of- Returns:
- the classloader of the library
-
isLoaded
public boolean isLoaded(@NotNull @NotNull RuntimeLibrary library)Check if aRuntimeLibraryis loaded in the server's classpath- Parameters:
library- the library to check- Returns:
- whether the library is loaded
- See Also:
isLoadedIsolated(RuntimeLibrary)
-
isLoadedIsolated
public boolean isLoadedIsolated(@NotNull @NotNull RuntimeLibrary library)Check if aRuntimeLibraryis loaded in an isolated classloader- Parameters:
library- the library to check- Returns:
- whether the library is loaded
- See Also:
isLoaded(RuntimeLibrary)
-
-