Package org.apache.nutch.plugin

## Class PluginClassLoader

- java.lang.Object
- - java.lang.ClassLoader
  - - java.security.SecureClassLoader
    - - java.net.URLClassLoader
      - - org.apache.nutch.plugin.PluginClassLoader

- All Implemented Interfaces:
    `Closeable`, `AutoCloseable`

      public class PluginClassLoader
      extends URLClassLoader

  The `PluginClassLoader` is a child-first classloader that only contains classes of the runtime libraries setuped in the plugin manifest file and exported libraries of plugins that are required plugins. Libraries can be exported or not. Not exported libraries are only used in the plugin own `PluginClassLoader`. Exported libraries are available for `PluginClassLoader` of plugins that depends on these plugins.

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PluginClassLoader​(URL[] urls, ClassLoader parent)` | Overloaded constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `boolean` | `equals​(Object obj)` |
    `URL` | `getResource​(String name)` |
    `InputStream` | `getResourceAsStream​(String name)` |
    `Enumeration<URL>` | `getResources​(String name)` |
    `int` | `hashCode()` |
    `protected Class<?>` | `loadClass​(String name, boolean resolve)` |

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

      `addURL, close, definePackage, findClass, findResource, findResources, getPermissions, 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, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

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

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

- - ### Constructor Detail

    - #### PluginClassLoader

          public PluginClassLoader​(URL[] urls,
                                   ClassLoader parent)

      Overloaded constructor
      Parameters:
        `urls` - Array of urls with own libraries and all exported libraries of plugins that are required for this plugin
        `parent` - the parent `ClassLoader` responsible for loading classes defined in urls.

  - ### Method Detail

    - #### loadClass

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

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

    - #### getResource

          public URL getResource​(String name)

      Overrides:
        `getResource` in class `ClassLoader`

    - #### getResources

          public Enumeration<URL> getResources​(String name)
                                        throws IOException

      Overrides:
        `getResources` in class `ClassLoader`
      Throws:
        `IOException`

    - #### getResourceAsStream

          public InputStream getResourceAsStream​(String name)

      Overrides:
        `getResourceAsStream` in class `URLClassLoader`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals​(Object obj)

      Overrides:
        `equals` in class `Object`