org.apache.uima.fit.internal

## Class ClassLoaderUtils

- java.lang.Object
- - org.apache.uima.fit.internal.ClassLoaderUtils

-     public final class ClassLoaderUtils
      extends Object

  INTERNAL API - Helper functions to obtain a suitable classloader.

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static ClassLoader` | `findClassloader()` Looks up a suitable classloader in the following order: The `UimaContext` in the `UimaContextHolder` of the current thread(if any) The current thread-context classloader (if any) The classloader through which uimaFIT (i.e.
    `static ClassLoader` | `findClassloader(ResourceManager aResMgr)` Looks up a suitable classloader in the following order: The extension classloader of the given `ResourceManager` See `findClassloader()`
    `static ClassLoader` | `findClassloader(UimaContext aContext)` Looks up a suitable classloader in the following order: The extension classloader of the `ResourceManager` associated with the given `UimaContext` (if any) See `findClassloader(ResourceManager)`

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

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

- - ### Method Detail

    - #### findClassloader

          public static ClassLoader findClassloader()

      Looks up a suitable classloader in the following order:
      1. The `UimaContext` in the `UimaContextHolder` of the current thread(if any)
      2. The current thread-context classloader (if any)
      3. The classloader through which uimaFIT (i.e. this class) was loaded.
      4. For backwards compatibility then delegates to `ClassUtils.getDefaultClassLoader()`
      Returns:
        a classloader or `null` if no suitable classloader could be found.

    - #### findClassloader

          public static ClassLoader findClassloader(ResourceManager aResMgr)

      Looks up a suitable classloader in the following order:
      1. The extension classloader of the given `ResourceManager`
      2. See `findClassloader()`
      Returns:
        a classloader or `null` if no suitable classloader could be found.

    - #### findClassloader

          public static ClassLoader findClassloader(UimaContext aContext)

      Looks up a suitable classloader in the following order:
      1. The extension classloader of the `ResourceManager` associated with the given `UimaContext` (if any)
      2. See `findClassloader(ResourceManager)`
      Returns:
        a classloader or `null` if no suitable classloader could be found.

Copyright © 2012–2021 The Apache Software Foundation. All rights reserved.