Class ModuleURLClassLoader

java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
eu.cloudnetservice.driver.impl.module.ModuleURLClassLoader
All Implemented Interfaces:
eu.cloudnetservice.driver.inject.InjectionLayerHolder<Injector>, Closeable, AutoCloseable

public class ModuleURLClassLoader extends URLClassLoader implements eu.cloudnetservice.driver.inject.InjectionLayerHolder<Injector>
This module url class loader is a unique url class loader for each module. Loading a class using this ClassLoader ensures that all other modules have access to the loaded class too.
Since:
4.0
See Also:
  • Module
  • Field Details

    • CLASS_LOADING_LOCK

      protected static final Lock CLASS_LOADING_LOCK
      All loaders which were created and of which the associated module is still loaded.
    • LOADERS

      protected static final Set<ModuleURLClassLoader> LOADERS
    • injectionLayer

      protected final eu.cloudnetservice.driver.inject.InjectionLayer<Injector> injectionLayer
  • Constructor Details

    • ModuleURLClassLoader

      public ModuleURLClassLoader(@NonNull @NonNull URL moduleFileUrl, @NonNull @NonNull Set<URL> moduleDependencyUrls, @NonNull @NonNull eu.cloudnetservice.driver.inject.InjectionLayer<Injector> injectionLayer)
      Creates an instance of this FinalizeURLClassLoader.
      Parameters:
      moduleFileUrl - the module file to which this loader is associated.
      moduleDependencyUrls - all dependencies which were loaded for the module.
      injectionLayer - the injection layer for the module associated with this loader.
      Throws:
      NullPointerException - if moduleFileUrl or moduleDependencyUrls is null.
  • Method Details