Class ExtensionClassLoader

java.lang.Object
java.lang.ClassLoader
com.nomagic.magicreport.ExtensionClassLoader

@OpenApiAll public class ExtensionClassLoader extends ClassLoader
This class loader is used to provide class loader for MagicReport extension. This loader will load classes and resources from a search URLs referring to JAR files and prevent resource locking from class loader.
Since:
Mar 28, 2008
  • Constructor Details

    • ExtensionClassLoader

      public ExtensionClassLoader(URL url)
      Constructs a new URLClassLoader for the specified URL using the system class loader as parent ClassLoader. The URL will be searched in the order specified for classes and resources after first searching in the specified parent class loader.The URL is assumed to refer to a JAR file.
      Parameters:
      url - the URL from which to load classes and resources
    • ExtensionClassLoader

      public ExtensionClassLoader(URL[] urls)
      Constructs a new URLClassLoader for the specified URLs using the system class loader as parent ClassLoader. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader.The URL is assumed to refer to a JAR file.
      Parameters:
      urls - the URLs from which to load classes and resources
    • ExtensionClassLoader

      public ExtensionClassLoader(URL[] urls, ClassLoader parent)
      Constructs a new ExtensionClassLoader for the given URLs. The URLs will be searched in the order specified for classes and resources after first searching in the specified parent class loader.The URL is assumed to refer to a JAR file.
      Parameters:
      urls - the URLs from which to load classes and resources
      parent - the parent class loader for delegation
  • Method Details

    • getURLClassLoader

      public URLClassLoader getURLClassLoader()
      Return url class loader
      Returns:
      URLClassLoader
    • getParentClassLoader

      public ClassLoader getParentClassLoader()
      Return parent class loader for delegation
      Returns:
      parent class loader
    • getOtherClassLoaders

      public List<ClassLoader> getOtherClassLoaders()
      Return other class loaders for delegation
      Returns:
      OtherClassLoaders
    • setOtherClassLoader

      public void setOtherClassLoader(List<ClassLoader> otherClassLoaders)
      Set other class loaders for delegation
      Parameters:
      otherClassLoaders - other class loaders for delegation
    • addOtherClassLoader

      public void addOtherClassLoader(ClassLoader otherClassLoader)
      Add other class loader
      Parameters:
      otherClassLoader - other class loaders for delegation
    • loadClass

      public Class<?> loadClass(String name) throws ClassNotFoundException
      Overrides:
      loadClass in class ClassLoader
      Throws:
      ClassNotFoundException
    • loadClass

      protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException
      Overrides:
      loadClass in class ClassLoader
      Throws:
      ClassNotFoundException