Package com.sleepycat.util

## Class ClassResolver

- java.lang.Object
- - com.sleepycat.util.ClassResolver

-     public class ClassResolver
      extends java.lang.Object

  Implements policies for loading user-supplied classes. The `resolveClass(java.lang.String, java.lang.ClassLoader)` method should be used to load all user-supplied classes, and the `ClassResolver.Stream` class should be used as a replacement for ObjectInputStream to deserialize instances of user-supplied classes.

  The ClassLoader specified as a param should be the one configured using EnvironmentConfig.setClassLoader. This loader is used, if non-null. If the loader param is null, but a non-null thread-context loader is available, the latter is used. If the loader param and thread-context loader are both null, or if they fail to load a class by throwing ClassNotFoundException, then the default Java mechanisms for determining the class loader are used.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static class` | `ClassResolver.Stream` | A specialized ObjectInputStream that supports use of a user-specified ClassLoader.

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `ClassResolver()` |

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `static java.lang.Class` | `resolveClass​(java.lang.String className, java.lang.ClassLoader classLoader)` | A specialized Class.forName method that supports use of a user-specified ClassLoader.

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

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

- - ### Constructor Detail

    - #### ClassResolver

          public ClassResolver()

  - ### Method Detail

    - #### resolveClass

          public static java.lang.Class resolveClass​(java.lang.String className,
                                                     java.lang.ClassLoader classLoader)
                                              throws java.lang.ClassNotFoundException

      A specialized Class.forName method that supports use of a user-specified ClassLoader. If the loader param and thread-context loader are both null, of if they throw ClassNotFoundException, then Class.forName is called and the "current loader" (the one used to load JE) will be used.
      Parameters:
        `className` - the class name.
        `classLoader` - the ClassLoader.
      Returns:
        the Class.
      Throws:
        `java.lang.ClassNotFoundException` - if the class is not found.

Copyright (c) 1996, 2020 Oracle and/or its affiliates. All rights reserved.