public class SshThreadPoolExecutor extends java.util.concurrent.ThreadPoolExecutor implements CloseableExecutorService
| Modifier and Type | Class and Description |
|---|---|
protected class |
SshThreadPoolExecutor.DelegateCloseable |
java.util.concurrent.ThreadPoolExecutor.AbortPolicy, java.util.concurrent.ThreadPoolExecutor.CallerRunsPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardOldestPolicy, java.util.concurrent.ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Field and Description |
|---|---|
protected SshThreadPoolExecutor.DelegateCloseable |
closeable |
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT| Constructor and Description |
|---|
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue) |
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.RejectedExecutionHandler handler) |
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory) |
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.RejectedExecutionHandler handler) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCloseFutureListener(SshFutureListener<CloseFuture> listener)
Pre-register a listener to be informed when resource is closed.
|
boolean |
awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit) |
CloseFuture |
close(boolean immediately)
Close this resource asynchronously and return a future.
|
boolean |
isClosed()
Returns
true if this object has been closed. |
boolean |
isClosing()
Returns
true if the Closeable.close(boolean) method has been called. |
boolean |
isShutdown() |
boolean |
isTerminated() |
boolean |
isTerminating() |
void |
removeCloseFutureListener(SshFutureListener<CloseFuture> listener)
Remove a pre-registered close event listener
|
void |
shutdown() |
java.util.List<java.lang.Runnable> |
shutdownNow() |
protected void |
terminated() |
afterExecute, allowCoreThreadTimeOut, allowsCoreThreadTimeOut, beforeExecute, execute, finalize, getActiveCount, getCompletedTaskCount, getCorePoolSize, getKeepAliveTime, getLargestPoolSize, getMaximumPoolSize, getPoolSize, getQueue, getRejectedExecutionHandler, getTaskCount, getThreadFactory, prestartAllCoreThreads, prestartCoreThread, purge, remove, setCorePoolSize, setKeepAliveTime, setMaximumPoolSize, setRejectedExecutionHandler, setThreadFactory, toStringinvokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submitclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitawaitTerminationinvokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submitclose, close, getMaxCloseWaitTime, isOpenprotected final SshThreadPoolExecutor.DelegateCloseable closeable
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue)
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory)
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.RejectedExecutionHandler handler)
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
java.util.concurrent.TimeUnit unit,
java.util.concurrent.BlockingQueue<java.lang.Runnable> workQueue,
java.util.concurrent.ThreadFactory threadFactory,
java.util.concurrent.RejectedExecutionHandler handler)
protected void terminated()
terminated in class java.util.concurrent.ThreadPoolExecutorpublic void shutdown()
shutdown in interface java.util.concurrent.ExecutorServiceshutdown in class java.util.concurrent.ThreadPoolExecutorpublic java.util.List<java.lang.Runnable> shutdownNow()
shutdownNow in interface java.util.concurrent.ExecutorServiceshutdownNow in class java.util.concurrent.ThreadPoolExecutorpublic boolean isShutdown()
isShutdown in interface java.util.concurrent.ExecutorServiceisShutdown in class java.util.concurrent.ThreadPoolExecutorpublic boolean isTerminating()
isTerminating in class java.util.concurrent.ThreadPoolExecutorpublic boolean isTerminated()
isTerminated in interface java.util.concurrent.ExecutorServiceisTerminated in class java.util.concurrent.ThreadPoolExecutorpublic boolean awaitTermination(long timeout,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
awaitTermination in interface java.util.concurrent.ExecutorServiceawaitTermination in class java.util.concurrent.ThreadPoolExecutorjava.lang.InterruptedExceptionpublic CloseFuture close(boolean immediately)
Closeableimmediately - true if the resource should be shut down abruptly, false for a
graceful closeCloseFuture representing the close requestpublic void addCloseFutureListener(SshFutureListener<CloseFuture> listener)
Closeablelistener - The notification SshFutureListener - never nullpublic void removeCloseFutureListener(SshFutureListener<CloseFuture> listener)
Closeablelistener - The register SshFutureListener - never null. Ignored if not registered or
resource already closedpublic boolean isClosed()
Closeabletrue if this object has been closed.true if closingpublic boolean isClosing()
Closeabletrue if the Closeable.close(boolean) method has been called. Note that this method will
return true even if this Closeable.isClosed() returns true.true if closing