org.apache.ignite.osgi.classloaders

## Class BundleDelegatingClassLoader

- java.lang.Object
- - java.lang.ClassLoader
  - - org.apache.ignite.osgi.classloaders.BundleDelegatingClassLoader

- Direct Known Subclasses:
    ContainerSweepClassLoader

      public class BundleDelegatingClassLoader
      extends ClassLoader

  A `ClassLoader` implementation delegating to a given OSGi bundle, and to the specified `ClassLoader` as a fallback.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.osgi.framework.Bundle` | `bundle` The bundle which loaded Ignite.
    `protected ClassLoader` | `clsLdr` The fallback classloader, expected to be the ignite-core classloader.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BundleDelegatingClassLoader(org.osgi.framework.Bundle bundle)` Constructor.
    `BundleDelegatingClassLoader(org.osgi.framework.Bundle bundle, ClassLoader classLoader)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected ClassNotFoundException` | `classNotFoundException(String clsName)` Builds a `ClassNotFoundException`.
    `protected Class<?>` | `findClass(String name)`
    `protected URL` | `findResource(String name)`
    `protected Enumeration` | `findResources(String name)`
    `org.osgi.framework.Bundle` | `getBundle()` Returns the `Bundle` to which this ClassLoader is associated.
    `protected Class<?>` | `loadClass(String name, boolean resolve)`
    `String` | `toString()`

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

      `clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findLibrary, findLoadedClass, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResource, getResourceAsStream, 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, wait, wait, wait`

- - ### Field Detail

    - #### bundle

          protected final org.osgi.framework.Bundle bundle

      The bundle which loaded Ignite.

    - #### clsLdr

          @GridToStringExclude
          protected final ClassLoader clsLdr

      The fallback classloader, expected to be the ignite-core classloader.

  - ### Constructor Detail

    - #### BundleDelegatingClassLoader

          public BundleDelegatingClassLoader(org.osgi.framework.Bundle bundle)

      Constructor.
      Parameters:
        `bundle` - The bundle

    - #### BundleDelegatingClassLoader

          public BundleDelegatingClassLoader(org.osgi.framework.Bundle bundle,
                                             ClassLoader classLoader)

      Constructor.
      Parameters:
        `bundle` - The bundle.
        `classLoader` - Fallback classloader.

  - ### Method Detail

    - #### findClass

          protected Class<?> findClass(String name)
                                throws ClassNotFoundException

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

    - #### findResource

          protected URL findResource(String name)

      Overrides:
        `findResource` in class `ClassLoader`

    - #### findResources

          protected Enumeration findResources(String name)
                                       throws IOException

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

    - #### loadClass

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

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

    - #### getBundle

          public org.osgi.framework.Bundle getBundle()

      Returns the `Bundle` to which this ClassLoader is associated.
      Returns:
        The Bundle.

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### classNotFoundException

          protected ClassNotFoundException classNotFoundException(String clsName)

      Builds a `ClassNotFoundException`.
      Parameters:
        `clsName` - Class name.
      Returns:
        The exception.

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022