public void executeNonBlocking(final Runnable task) throws RejectedExecutionException { delegate.execute(task); }
public void run() { executor.execute(task); }
public void execute(final Runnable task) { delegate.execute(task); }
public void execute(final Runnable command) { AccessController.doPrivileged((PrivilegedAction<Void>) () -> { delegate.execute(command); return null; }, context); }
public void execute(final Runnable command) { try { delegate.execute(command); } catch (Throwable t) { log.logf(level, t, "Exception thrown from thread task"); } }
public void execute(final Runnable command) { initializer.run(); delegate.execute(command); }
public void executeBlocking(final Runnable task) throws RejectedExecutionException, InterruptedException { try { delegate.execute(task); } catch (ExecutionInterruptedException e) { if (Thread.interrupted()) { throw new InterruptedException(); } else { throw e; } } } }
public void executeBlocking(final Runnable task, final long timeout, final TimeUnit unit) throws RejectedExecutionException, InterruptedException { try { delegate.execute(task); } catch (ExecutionInterruptedException e) { if (Thread.interrupted()) { throw new InterruptedException(); } else { throw e; } } }
public void run() { try { synchronized (lock) { int t = ++currentThreadCount; if (t > largestThreadCount) { largestThreadCount = t; } } taskExecutor.execute(task); synchronized (lock) { currentThreadCount--; } } finally { limitSemaphore.release(); } } });
public void run() { try { synchronized (lock) { int t = ++currentThreadCount; if (t > largestThreadCount) { largestThreadCount = t; } } taskExecutor.execute(task); synchronized (lock) { currentThreadCount--; } } finally { limitSemaphore.release(); } } });
public void run() { try { synchronized (lock) { int t = ++currentThreadCount; if (t > largestThreadCount) { largestThreadCount = t; } } taskExecutor.execute(task); synchronized (lock) { currentThreadCount--; } } finally { limitSemaphore.release(); } } });
public void run() { try { synchronized (lock) { int t = ++currentThreadCount; if (t > largestThreadCount) { largestThreadCount = t; } } taskExecutor.execute(task); synchronized (lock) { currentThreadCount--; } } finally { limitSemaphore.release(); } } });
public void execute(final Runnable command) { final Thread thr = Thread.currentThread(); final String oldName = thr.getName(); thr.setName(newName); try { delegate.execute(command); } finally { thr.setName(oldName); } }
public void execute(final Runnable command) { final Thread thr = Thread.currentThread(); ClassLoader old = thr.getContextClassLoader(); thr.setContextClassLoader(taskClassLoader); try { delegate.execute(command); } finally { thr.setContextClassLoader(old); } }
public void execute(final Runnable command) { final Thread thr = Thread.currentThread(); final String oldName; oldName = thr.getName(); thr.setName(oldName + " (" + notation + ')'); try { delegate.execute(command); } finally { thr.setName(oldName); } }
private void runTask(Runnable task) { if (task != null) try { taskExecutor.execute(task); } catch (Throwable t) { Messages.msg.executionFailed(t, task); } }
/** * Defer interrupts for the duration of some task. Once the task is complete, any deferred interrupt will be * delivered to the thread, thus the thread interrupt status should be checked upon return. If the current thread * is not a {@code JBossThread}, the task is simply run as-is. * * @param directExecutor the task executor to use * @param task the task to run */ public static void executeWithInterruptDeferred(final DirectExecutor directExecutor, final Runnable task) { final JBossThread thread = currentThread(); if (registerDeferral(thread)) try { directExecutor.execute(task); } finally { unregisterDeferral(thread); } else { // already deferred directExecutor.execute(task); } }
public void execute(final Runnable command) { final JBossThread thr = JBossThread.currentThread(); final String oldName = thr.getName(); thr.setName(thr.getThreadNameInfo().format(thr, nameFormat)); try { delegate.execute(command); } finally { thr.setName(oldName); } }
/** * Run a task through the given direct executor, invoking the given notifier with the given attachment. * * @param task the task * @param directExecutor the executor * @param notifier the notifier * @param attachment the attachment * @param <R> the task type * @param <A> the attachment type */ public static <R extends Runnable, A> void run(R task, DirectExecutor directExecutor, TaskNotifier<? super R, ? super A> notifier, A attachment) { started(notifier, task, attachment); boolean ok = false; try { directExecutor.execute(task); ok = true; } catch (RuntimeException t) { failed(notifier, t, task, attachment); throw t; } catch (Error t) { failed(notifier, t, task, attachment); throw t; } catch (Throwable t) { failed(notifier, t, task, attachment); throw Messages.msg.unknownThrowable(t); } finally { if (ok) finished(notifier, task, attachment); } }