Class FlinkUserCodeClassLoaders.SafetyNetWrapperClassLoader

  • All Implemented Interfaces:
    Closeable, AutoCloseable
    Direct Known Subclasses:
    ClientWrapperClassLoader
    Enclosing class:
    FlinkUserCodeClassLoaders

    @Internal
    public static class FlinkUserCodeClassLoaders.SafetyNetWrapperClassLoader
    extends MutableURLClassLoader
    Ensures that holding a reference on the context class loader outliving the scope of user code does not prevent the user classloader to be garbage collected (FLINK-16245).

    This classloader delegates to the actual user classloader. Upon close(), the delegate is nulled and can be garbage collected. Additional class resolution will be resolved solely through the bootstrap classloader and most likely result in ClassNotFound exceptions.