public class

ClassLoaderUtil

extends Object
java.lang.Object
   ↳ sun.misc.ClassLoaderUtil

Summary

Public Constructors
ClassLoaderUtil()
Public Methods
static void releaseLoader(URLClassLoader classLoader)
Releases resources held by a URLClassLoader.
static List<IOException> releaseLoader(URLClassLoader classLoader, List<String> jarsClosed)
Releases resources held by a URLClassLoader.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClassLoaderUtil ()

Public Methods

public static void releaseLoader (URLClassLoader classLoader)

Releases resources held by a URLClassLoader. A new classloader must be created before the underlying resources can be accessed again.

Parameters
classLoader the instance of URLClassLoader (or a subclass)

public static List<IOException> releaseLoader (URLClassLoader classLoader, List<String> jarsClosed)

Releases resources held by a URLClassLoader. Notably, close the jars opened by the loader. Initializes and updates the List of jars that have been successfully closed.

Parameters
classLoader the instance of URLClassLoader (or a subclass)
jarsClosed a List of Strings that will contain the names of jars successfully closed; can be null if the caller does not need the information returned
Returns
  • a List of IOExceptions reporting jars that failed to close; null indicates that an error other than an IOException occurred attempting to release the loader; empty indicates a successful release; non-empty indicates at least one error attempting to close an open jar.