@Nullable public static <R>R wrapThreadLoader(ClassLoader ldr,IgniteOutClosure<R> c){
  Thread curThread=Thread.currentThread();
  ClassLoader ctxLdr=curThread.getContextClassLoader();
  try {
    curThread.setContextClassLoader(ldr);
    return c.apply();
  }
  finally {
    curThread.setContextClassLoader(ctxLdr);
  }
}

@ Nullable public static < R > R wrapThreadLoader ( ClassLoader ldr , IgniteOutClosure < R > c ) { Thread curThread = Thread . currentThread ( ) ; ClassLoader ctxLdr = curThread . getContextClassLoader ( ) ; try { curThread . setContextClassLoader ( ldr ) ; return c . apply ( ) ; } finally { curThread . setContextClassLoader ( ctxLdr ) ; } }
sets thread context class loader to the given loader , executes the closure , and then resets thread context class loader to its initial value .
