Class AddonClassLoader

All Implemented Interfaces:
Closeable, AutoCloseable

public final class AddonClassLoader extends CraftsNetClassLoader
Class responsible for loading addons dynamically into the CraftsNet framework.
Since:
3.0.3-SNAPSHOT
See Also:
  • Method Details

    • loadClass

      protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
      Loads the class with the specified name, optionally linking it after loading.
      Overrides:
      loadClass in class ClassLoader
      Parameters:
      name - The binary name of the class to be loaded.
      resolve - true to resolve the class; false to skip resolution.
      Returns:
      The Class object representing the loaded class.
      Throws:
      ClassNotFoundException - If the class could not be found.
    • findClass

      protected Class<?> findClass(String name) throws ClassNotFoundException
      Finds the class with the specified binary name.
      Overrides:
      findClass in class URLClassLoader
      Parameters:
      name - The binary name of the class to be found.
      Returns:
      The Class object representing the class, or null if the class could not be found.
      Throws:
      ClassNotFoundException - If the class could not be found.
    • getAddonLoaders

      public static Set<AddonClassLoader> getAddonLoaders()
      Get a list of all AddonClassLoader which are currently active.
      Returns:
      The set of AddonClassLoader.