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, toString
invokeAll, invokeAll, invokeAny, invokeAny, newTaskFor, newTaskFor, submit, submit, submit
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
awaitTermination
invokeAll, invokeAll, invokeAny, invokeAny, submit, submit, submit
close, close, getMaxCloseWaitTime, isOpen
protected 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 ThreadPoolExecutor
public void shutdown()
shutdown
in interface ExecutorService
shutdown
in class ThreadPoolExecutor
public List<Runnable> shutdownNow()
shutdownNow
in interface ExecutorService
shutdownNow
in class ThreadPoolExecutor
public boolean isShutdown()
isShutdown
in interface ExecutorService
isShutdown
in class ThreadPoolExecutor
public boolean isTerminating()
isTerminating
in class ThreadPoolExecutor
public boolean isTerminated()
isTerminated
in interface ExecutorService
isTerminated
in class ThreadPoolExecutor
public boolean awaitTermination(long timeout, TimeUnit unit) throws InterruptedException
awaitTermination
in interface ExecutorService
awaitTermination
in class ThreadPoolExecutor
InterruptedException
public CloseFuture close(boolean immediately)
Closeable
immediately
- true
if the resource should be shut down abruptly, false
for a
graceful closeCloseFuture
representing the close requestpublic void addCloseFutureListener(SshFutureListener<CloseFuture> listener)
Closeable
listener
- The notification SshFutureListener
- never null
public void removeCloseFutureListener(SshFutureListener<CloseFuture> listener)
Closeable
listener
- The register SshFutureListener
- never null
. Ignored if not registered or
resource already closedpublic boolean isClosed()
Closeable
true
if this object has been closed.true
if closingpublic boolean isClosing()
Closeable
true
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 © 2008–2024 The Apache Software Foundation. All rights reserved.