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 using
AnnoyingLibrary-
Field Summary
Fields inherited from class net.byteflux.libby.LibraryManager
logger, saveDirectory -
Constructor Summary
ConstructorsConstructorDescriptionAnnoyingLibraryManager(@NotNull AnnoyingPlugin plugin) Create a newAnnoyingLibraryManagerfor the pluginAnnoyingLibraryManager(@NotNull AnnoyingPlugin plugin, @NotNull String directoryName) Create a newAnnoyingLibraryManagerfor the plugin with a custom directory name -
Method Summary
Modifier and TypeMethodDescription@NotNull AnnoyingPluginTheAnnoyingPlugininstance@NotNull Optional<net.byteflux.libby.classloader.IsolatedClassLoader> getIsolatedClassLoaderOf(@NotNull AnnoyingLibrary library) Get theIsolatedClassLoaderof aAnnoyingLibrarybooleanisLoaded(@NotNull AnnoyingLibrary library) Check if aAnnoyingLibraryis loaded in the server's classpathbooleanisLoadedIsolated(@NotNull AnnoyingLibrary library) Check if aAnnoyingLibraryis loaded in an isolated classloaderbooleanloadLibrary(@NotNull AnnoyingLibrary library) Load aAnnoyingLibraryinto the server's classpath@Nullable net.byteflux.libby.classloader.IsolatedClassLoaderloadLibraryIsolated(@NotNull AnnoyingLibrary library) Load aAnnoyingLibraryinto an isolated classloaderMethods inherited from class net.byteflux.libby.BukkitLibraryManager
addToClasspathMethods inherited from class net.byteflux.libby.LibraryManager
addJCenter, addJitPack, addMavenCentral, addMavenLocal, addRepository, addSonatype, addToIsolatedClasspath, downloadLibrary, getIsolatedClassLoaderOf, getLogLevel, getRepositories, loadLibrary, resolveLibrary, setLogLevel
-
Constructor Details
-
AnnoyingLibraryManager
Create a newAnnoyingLibraryManagerfor the plugin- Parameters:
plugin-plugin
-
AnnoyingLibraryManager
public AnnoyingLibraryManager(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull 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 Details
-
getAnnoyingPlugin
Description copied from interface:AnnoyableTheAnnoyingPlugininstance- Specified by:
getAnnoyingPluginin interfaceAnnoyable- Returns:
- the plugin instance
-
loadLibrary
Load aAnnoyingLibraryinto the server's classpath- Parameters:
library- the library to load- Returns:
- whether the library was loaded successfully
- See Also:
-
loadLibraryIsolated
@Nullable public @Nullable net.byteflux.libby.classloader.IsolatedClassLoader loadLibraryIsolated(@NotNull @NotNull AnnoyingLibrary library) Load aAnnoyingLibraryinto an isolated classloader- Parameters:
library- the library to load- Returns:
- the isolated classloader containing the library, or null if the library failed to load
- See Also:
-
getIsolatedClassLoaderOf
@NotNull public @NotNull Optional<net.byteflux.libby.classloader.IsolatedClassLoader> getIsolatedClassLoaderOf(@NotNull @NotNull AnnoyingLibrary library) Get theIsolatedClassLoaderof aAnnoyingLibrary- Parameters:
library- the library to get the classloader of- Returns:
- the classloader of the library
-
isLoaded
Check if aAnnoyingLibraryis loaded in the server's classpath- Parameters:
library- the library to check- Returns:
- whether the library is loaded
- See Also:
-
isLoadedIsolated
Check if aAnnoyingLibraryis loaded in an isolated classloader- Parameters:
library- the library to check- Returns:
- whether the library is loaded
- See Also:
-