public class ObservableExecutorService extends ThreadPoolExecutor
ExecutorObserver instances
about the progress of processing the submitted tasks.AbstractExecutorService.submit(Runnable),
AbstractExecutorService.submit(Callable) or AbstractExecutorService.submit(Runnable, Object). It
will not be possible for tasks that are submitted with
execute(Runnable).ObservableExecutorPanel,
which will track the task execution and display information about the
active tasks and in the UI. If the tasks that are submitted to this
executor service implement the ProgressTask interface (for
example, instances of the GenericProgressTask class),
then the UI may show additional information about the progress
of each individual task.ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Method and Description |
|---|---|
void |
addExecutorObserver(ExecutorObserver executorObserver)
Add the given
ExecutorObserver to be informed about the
progress of the task execution. |
protected void |
afterExecute(Runnable r,
Throwable t) |
protected void |
beforeExecute(Thread t,
Runnable r) |
void |
execute(Runnable command) |
protected <V> RunnableFuture<V> |
newTaskFor(Callable<V> c) |
protected <V> RunnableFuture<V> |
newTaskFor(Runnable r,
V v) |
void |
removeExecutorObserver(ExecutorObserver executorObserver)
Remove the given
ExecutorObserver |
allowCoreThreadTimeOut, allowsCoreThreadTimeOut, awaitTermination, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, isShutdown, isTerminated, isTerminating, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, shutdown, shutdownNow, terminated, toStringpublic final void addExecutorObserver(ExecutorObserver executorObserver)
ExecutorObserver to be informed about the
progress of the task execution.null. If the observer
throws an exception in one of its methods, then an error message
will be printed. Beyond that, the exceptions will be ignored.executorObserver - The ExecutorObserverpublic final void removeExecutorObserver(ExecutorObserver executorObserver)
ExecutorObserverexecutorObserver - The ExecutorObserverprotected final <V> RunnableFuture<V> newTaskFor(Callable<V> c)
newTaskFor in class AbstractExecutorServiceprotected final <V> RunnableFuture<V> newTaskFor(Runnable r, V v)
newTaskFor in class AbstractExecutorServicepublic void execute(Runnable command)
execute in interface Executorexecute in class ThreadPoolExecutorprotected void beforeExecute(Thread t, Runnable r)
beforeExecute in class ThreadPoolExecutorprotected void afterExecute(Runnable r, Throwable t)
afterExecute in class ThreadPoolExecutorCopyright © 2016. All rights reserved.