public class SshThreadPoolExecutor extends ThreadPoolExecutor implements CloseableExecutorService
| Modifier and Type | Class and Description |
|---|---|
protected class |
SshThreadPoolExecutor.DelegateCloseable |
ThreadPoolExecutor.AbortPolicy, ThreadPoolExecutor.CallerRunsPolicy, ThreadPoolExecutor.DiscardOldestPolicy, ThreadPoolExecutor.DiscardPolicy| Modifier and Type | Field and Description |
|---|---|
protected SshThreadPoolExecutor.DelegateCloseable |
closeable |
| Constructor and Description |
|---|
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue) |
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
RejectedExecutionHandler handler) |
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory) |
SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory,
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,
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() |
List<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, waitawaitTermination, closeinvokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submitclose, getMaxCloseWaitTime, isOpenprotected final SshThreadPoolExecutor.DelegateCloseable closeable
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue)
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory)
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
RejectedExecutionHandler handler)
public SshThreadPoolExecutor(int corePoolSize,
int maximumPoolSize,
long keepAliveTime,
TimeUnit unit,
BlockingQueue<Runnable> workQueue,
ThreadFactory threadFactory,
RejectedExecutionHandler handler)
protected void terminated()
terminated in class ThreadPoolExecutorpublic void shutdown()
shutdown in interface ExecutorServiceshutdown in class ThreadPoolExecutorpublic List<Runnable> shutdownNow()
shutdownNow in interface ExecutorServiceshutdownNow in class ThreadPoolExecutorpublic boolean isShutdown()
isShutdown in interface ExecutorServiceisShutdown in class ThreadPoolExecutorpublic boolean isTerminating()
isTerminating in class ThreadPoolExecutorpublic boolean isTerminated()
isTerminated in interface ExecutorServiceisTerminated in class ThreadPoolExecutorpublic boolean awaitTermination(long timeout,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface ExecutorServiceawaitTermination in class ThreadPoolExecutorInterruptedExceptionpublic 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 closingCopyright © 2018–2024 The Apache Software Foundation. All rights reserved.