Class ContextLClassLoaderSwapper

java.lang.Object
org.zeroturnaround.javarebel.integration.util.ContextLClassLoaderSwapper

public class ContextLClassLoaderSwapper extends Object
Utility for temporary swapping the Thread.contextClassLoader. ClassLoader will be switched only if tempClassLoader != null. Example usage:
 ContextLClassLoaderSwapper classLoaderSwapper = new ContextLClassLoaderSwapper(tempCl).swap();
 try {
   ...
 } finally {
   classLoaderSwapper.restore();
 }
 
  • Constructor Details

    • ContextLClassLoaderSwapper

      public ContextLClassLoaderSwapper(ClassLoader tempClassLoader)
  • Method Details