/** * Returns true if this executor has been shut down. * * @return True if this executor has been shut down. */ public boolean isShutdown() { return (getWrapped() == null) || getWrapped().isShutdown(); }
/** * Returns true if this executor has been shut down. * * @return True if this executor has been shut down. */ public boolean isShutdown() { return getWrapped().isShutdown(); }
/** * * @param task * The task to submit. * @param result * The result to return. * @return A Future representing pending completion of the task, and whose * get() method will return the given result upon completion. */ public <T> Future<T> submit(Runnable task, T result) { return getWrapped().submit(task, result); }
/** * Submits a value-returning task for execution and returns a Future * representing the pending results of the task. * * @param task * The task to submit. * @return A Future representing pending completion of the task, and whose * get() method will return the given result upon completion. */ public <T> Future<T> submit(Callable<T> task) { return getWrapped().submit(task); }
/** * Returns true if all tasks have completed following shut down. Note that * isTerminated is never true unless either shutdown or shutdownNow was * called first. * * @return True if all tasks have completed following shut down. */ public boolean isTerminated() { return getWrapped().isTerminated(); }
/** * * @param task * The task to submit. * @return A Future representing pending completion of the task, and whose * get() method will return the given result upon completion. */ public Future<?> submit(Runnable task) { return getWrapped().submit(task); }
/** * Executes the given command asynchronously. * * @param command * The command to execute. */ public void execute(Runnable command) { getWrapped().execute(command); }
@Override public synchronized void stop() throws Exception { super.stop(); if ((getWrapped() != null) && !getWrapped().isShutdown()) { getWrapped().shutdown(); } }
/** * Returns true if all tasks have completed following shut down. Note that * isTerminated is never true unless either shutdown or shutdownNow was * called first. * * @return True if all tasks have completed following shut down. */ public boolean isTerminated() { return (getWrapped() == null) || getWrapped().isTerminated(); }
/** * Initiates an orderly shutdown in which previously submitted tasks are * executed, but no new tasks will be accepted. */ public void shutdown() { if (isShutdownAllowed() && (getWrapped() != null)) { getWrapped().shutdown(); } }
@Override public synchronized void stop() throws Exception { super.stop(); if (!getWrapped().isShutdown()) { getWrapped().shutdown(); } }
/** * Attempts to stop all actively executing tasks, halts the processing of * waiting tasks, and returns a list of the tasks that were awaiting * execution. * * @return The list of tasks that never commenced execution; */ public List<Runnable> shutdownNow() { return isShutdownAllowed() && (getWrapped() != null) ? getWrapped() .shutdownNow() : Collections.<Runnable> emptyList(); }
/** * Initiates an orderly shutdown in which previously submitted tasks are * executed, but no new tasks will be accepted. */ public void shutdown() { if (isShutdownAllowed()) { getWrapped().shutdown(); } }
/** * * @param task * The task to submit. * @param result * The result to return. * @return A Future representing pending completion of the task, and whose * get() method will return the given result upon completion. */ public <T> Future<T> submit(Runnable task, T result) { startIfNeeded(); return getWrapped().submit(task, result); }
/** * Attempts to stop all actively executing tasks, halts the processing of * waiting tasks, and returns a list of the tasks that were awaiting * execution. * * @return The list of tasks that never commenced execution; */ public List<Runnable> shutdownNow() { return isShutdownAllowed() ? getWrapped().shutdownNow() : Collections .<Runnable> emptyList(); }
/** * Executes the given command asynchronously. * * @param command * The command to execute. */ public void execute(Runnable command) { startIfNeeded(); getWrapped().execute(command); }
/** * * @param task * The task to submit. * @return A Future representing pending completion of the task, and whose * get() method will return the given result upon completion. */ public Future<?> submit(Runnable task) { startIfNeeded(); return getWrapped().submit(task); }
/** * Submits a value-returning task for execution and returns a Future * representing the pending results of the task. * * @param task * The task to submit. * @return A Future representing pending completion of the task, and whose * get() method will return the given result upon completion. */ public <T> Future<T> submit(Callable<T> task) { startIfNeeded(); return getWrapped().submit(task); }
@Override public synchronized void start() throws Exception { if ((getWrapped() == null) || getWrapped().isShutdown()) { setWrapped(wrap(createExecutorService(getCorePoolSize()))); } super.start(); }
@Override public synchronized void start() throws Exception { if (getWrapped().isShutdown()) { setWrapped(wrap(createExecutorService())); } super.start(); }