org.apache.struts2

## Class Main.MainClassLoader

- java.lang.Object
- - java.lang.ClassLoader
  - - java.security.SecureClassLoader
    - - java.net.URLClassLoader
      - - org.apache.struts2.Main.MainClassLoader

- All Implemented Interfaces:
    Closeable, AutoCloseable
  Enclosing class:
    Main

      public static class Main.MainClassLoader
      extends URLClassLoader

  Reverses the typical order of classloading to defer only to the parent if the current class loader can't be found. This is required to allow for the launcher to be embedded within struts.jar (otherwise the dependencies wouldn't be found by the system ClassLoader when invoking using "java -jar struts-core-VERSION.jar ...").

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Main.MainClassLoader(URL[] urls)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Class<?>` | `loadClass(String name, boolean resolve)`

    - ### Methods inherited from class java.net.URLClassLoader

      `addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstance`

    - ### Methods inherited from class java.security.SecureClassLoader

      `defineClass, defineClass`

    - ### Methods inherited from class java.lang.ClassLoader

      `clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Main.MainClassLoader

          public Main.MainClassLoader(URL[] urls)

  - ### Method Detail

    - #### loadClass

          public Class<?> loadClass(String name,
                           boolean resolve)
                             throws ClassNotFoundException

      Overrides:
        `loadClass` in class `ClassLoader`
      Throws:
        `ClassNotFoundException`

Copyright © 2000–2018 Apache Software Foundation. All rights reserved.