/** * Privileged method to get and set the context class loader of the given thread. * * @param thread the thread to introspect * @param newClassLoader the new context class loader * @return the old context class loader */ static ClassLoader getAndSetContextClassLoader(final Thread thread, final ClassLoader newClassLoader) { try { return getContextClassLoader(thread); } finally { setContextClassLoader(thread, newClassLoader); } }
static Runnable classLoaderPreservingTaskUnchecked(final Runnable delegate) { Assert.checkNotNullParam("delegate", delegate); return new ContextClassLoaderSavingRunnable(getContextClassLoader(Thread.currentThread()), delegate); }
/** * Privileged method to get and set the context class loader of the given thread. * * @param thread the thread to introspect * @param newClassLoader the new context class loader * @return the old context class loader */ static ClassLoader getAndSetContextClassLoader(final Thread thread, final ClassLoader newClassLoader) { try { return getContextClassLoader(thread); } finally { setContextClassLoader(thread, newClassLoader); } }
/** * Privileged method to get and set the context class loader of the given thread. * * @param thread the thread to introspect * @param newClassLoader the new context class loader * @return the old context class loader */ static ClassLoader getAndSetContextClassLoader(final Thread thread, final ClassLoader newClassLoader) { try { return getContextClassLoader(thread); } finally { setContextClassLoader(thread, newClassLoader); } }
static Runnable classLoaderPreservingTaskUnchecked(final Runnable delegate) { Assert.checkNotNullParam("delegate", delegate); return new ContextClassLoaderSavingRunnable(getContextClassLoader(Thread.currentThread()), delegate); }
static Runnable classLoaderPreservingTaskUnchecked(final Runnable delegate) { Assert.checkNotNullParam("delegate", delegate); return new ContextClassLoaderSavingRunnable(getContextClassLoader(Thread.currentThread()), delegate); }