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:
    java.io.Closeable, java.lang.AutoCloseable

      public class PluginClassLoader
      extends java.net.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 and Description
    `PluginClassLoader(java.net.URL[] urls, java.lang.ClassLoader parent)` Construtor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(java.lang.Object obj)`
    `java.net.URL` | `getResource(java.lang.String name)`
    `java.io.InputStream` | `getResourceAsStream(java.lang.String name)`
    `java.util.Enumeration<java.net.URL>` | `getResources(java.lang.String name)`
    `int` | `hashCode()`
    `protected java.lang.Class<?>` | `loadClass(java.lang.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, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, 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(java.net.URL[] urls,
                                   java.lang.ClassLoader parent)

      Construtor
      Parameters:
        `urls` - Array of urls with own libraries and all exported libraries of plugins that are required to this plugin
        `parent` -

  - ### Method Detail

    - #### loadClass

          protected java.lang.Class<?> loadClass(java.lang.String name,
                                                 boolean resolve)
                                          throws java.lang.ClassNotFoundException

      Overrides:
        `loadClass` in class `java.lang.ClassLoader`
      Throws:
        `java.lang.ClassNotFoundException`

    - #### getResource

          public java.net.URL getResource(java.lang.String name)

      Overrides:
        `getResource` in class `java.lang.ClassLoader`

    - #### getResources

          public java.util.Enumeration<java.net.URL> getResources(java.lang.String name)
                                                           throws java.io.IOException

      Overrides:
        `getResources` in class `java.lang.ClassLoader`
      Throws:
        `java.io.IOException`

    - #### getResourceAsStream

          public java.io.InputStream getResourceAsStream(java.lang.String name)

      Overrides:
        `getResourceAsStream` in class `java.net.URLClassLoader`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### equals

          public boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

Copyright © 2019 The Apache Software Foundation