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
  • Constructor Details

    • AnnoyingLibraryManager

      public AnnoyingLibraryManager(@NotNull @NotNull AnnoyingPlugin plugin)
      Create a new AnnoyingLibraryManager for the plugin
      Parameters:
      plugin - plugin
    • AnnoyingLibraryManager

      public AnnoyingLibraryManager(@NotNull @NotNull AnnoyingPlugin plugin, @NotNull @NotNull String directoryName)
      Create a new AnnoyingLibraryManager for the plugin with a custom directory name
      Parameters:
      plugin - plugin
      directoryName - the name of the directory to store the libraries in
  • Method Details

    • getAnnoyingPlugin

      @NotNull public @NotNull AnnoyingPlugin getAnnoyingPlugin()
      Description copied from interface: Annoyable
      The AnnoyingPlugin instance
      Specified by:
      getAnnoyingPlugin in interface Annoyable
      Returns:
      the plugin instance
    • loadLibrary

      public boolean loadLibrary(@NotNull @NotNull AnnoyingLibrary library)
      Load a AnnoyingLibrary into 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 a AnnoyingLibrary into 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 the IsolatedClassLoader of a AnnoyingLibrary
      Parameters:
      library - the library to get the classloader of
      Returns:
      the classloader of the library
    • isLoaded

      public boolean isLoaded(@NotNull @NotNull AnnoyingLibrary library)
      Check if a AnnoyingLibrary is loaded in the server's classpath
      Parameters:
      library - the library to check
      Returns:
      whether the library is loaded
      See Also:
    • isLoadedIsolated

      public boolean isLoadedIsolated(@NotNull @NotNull AnnoyingLibrary library)
      Check if a AnnoyingLibrary is loaded in an isolated classloader
      Parameters:
      library - the library to check
      Returns:
      whether the library is loaded
      See Also: