- All Implemented Interfaces:
public class ClassLoaderSanityThreadFactory extends Object implements ThreadFactoryExplicitly sets the
Thread#contextClassLoaderfor threads it creates to its own classloader. This avoids issues where threads are lazily created (ex by invoking
ScheduledExecutorService.schedule(Runnable, long, TimeUnit)) in a context where they would receive a customized
Thread#contextClassLoaderthat was never meant to be used. Commonly this is a problem for Groovy use, where this may result in memory leaks.
- See Also: