/** * Create a task that delegates to the given task, preserving the context classloader which was in effect when * this method was invoked. * * @param delegate the delegate runnable * @return the wrapping runnable * @throws SecurityException if a security manager exists and the caller does not have the {@code "copyClassLoader"} * {@link RuntimePermission}. */ public static Runnable classLoaderPreservingTask(final Runnable delegate) throws SecurityException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(COPY_CONTEXT_CLASSLOADER_PERMISSION); } return classLoaderPreservingTaskUnchecked(delegate); }
final Runnable realRunnable = JBossExecutors.classLoaderPreservingTaskUnchecked(runnable); int result; if (TAIL_LOCK) synchronized (tailLock) {
/** * Create a task that delegates to the given task, preserving the context classloader which was in effect when * this method was invoked. * * @param delegate the delegate runnable * @return the wrapping runnable * @throws SecurityException if a security manager exists and the caller does not have the {@code "copyClassLoader"} * {@link RuntimePermission}. */ public static Runnable classLoaderPreservingTask(final Runnable delegate) throws SecurityException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(COPY_CONTEXT_CLASSLOADER_PERMISSION); } return classLoaderPreservingTaskUnchecked(delegate); }
/** * Create a task that delegates to the given task, preserving the context classloader which was in effect when * this method was invoked. * * @param delegate the delegate runnable * @return the wrapping runnable * @throws SecurityException if a security manager exists and the caller does not have the {@code "copyClassLoader"} * {@link RuntimePermission}. */ public static Runnable classLoaderPreservingTask(final Runnable delegate) throws SecurityException { final SecurityManager sm = System.getSecurityManager(); if (sm != null) { sm.checkPermission(COPY_CONTEXT_CLASSLOADER_PERMISSION); } return classLoaderPreservingTaskUnchecked(delegate); }
final Runnable realRunnable = JBossExecutors.classLoaderPreservingTaskUnchecked(runnable); int result; if (TAIL_LOCK) synchronized (tailLock) {
final Runnable realRunnable = JBossExecutors.classLoaderPreservingTaskUnchecked(runnable); int result; if (TAIL_LOCK) synchronized (tailLock) {