Top Description Fields Constructors Methods
nonapi.io.github.classgraph.concurrency

public Class AutoCloseableExecutorService

extends ThreadPoolExecutor
implements AutoCloseable
Class Inheritance
All Implemented Interfaces
java.lang.AutoCloseable
Imports
java.util.concurrent.CancellationException, .ExecutionException, .Future, .LinkedBlockingQueue, .ThreadPoolExecutor, .TimeUnit

A ThreadPoolExecutor that can be used in a try-with-resources block.

Field Summary

Modifier and TypeField and Description
public final InterruptionChecker

Constructor Summary

AccessConstructor and Description
public
AutoCloseableExecutorService(final int
The number of threads to allocate.
numThreads
)

A ThreadPoolExecutor that can be used in a try-with-resources block.

Method Summary

Modifier and TypeMethod and Description
public void
afterExecute(final Runnable
the Runnable
runnable
,
final Throwable
the Throwable
throwable
)

Overrides java.util.concurrent.ThreadPoolExecutor.afterExecute.

Catch exceptions from both submit() and execute(), and call InterruptionChecker#interrupt() to interrupt all threads.

public void
close()

Overrides default java.util.concurrent.ExecutorService.close.

Implements java.lang.AutoCloseable.close.

Shut down thread pool on close().

Inherited from java.util.concurrent.ThreadPoolExecutor:
allowCoreThreadTimeOutallowsCoreThreadTimeOutawaitTerminationbeforeExecuteexecutefinalizegetActiveCountgetCompletedTaskCountgetCorePoolSizegetKeepAliveTimegetLargestPoolSizegetMaximumPoolSizegetPoolSizegetQueuegetRejectedExecutionHandlergetTaskCountgetThreadFactoryisShutdownisTerminatedisTerminatingprestartAllCoreThreadsprestartCoreThreadpurgeremovesetCorePoolSizesetKeepAliveTimesetMaximumPoolSizesetRejectedExecutionHandlersetThreadFactoryshutdownshutdownNowterminatedtoString

Field Detail

interruptionCheckerback to summary
public final InterruptionChecker interruptionChecker

The InterruptionChecker.

Constructor Detail

AutoCloseableExecutorServiceback to summary
public AutoCloseableExecutorService(final int numThreads)

A ThreadPoolExecutor that can be used in a try-with-resources block.

Parameters
numThreads:int

The number of threads to allocate.

Method Detail

afterExecuteback to summary
public void afterExecute(final Runnable runnable, final Throwable throwable)

Overrides java.util.concurrent.ThreadPoolExecutor.afterExecute.

Catch exceptions from both submit() and execute(), and call InterruptionChecker#interrupt() to interrupt all threads.

Parameters
runnable:Runnable

the Runnable

throwable:Throwable

the Throwable

Annotations
@Override
closeback to summary
public void close()

Overrides default java.util.concurrent.ExecutorService.close.

Implements java.lang.AutoCloseable.close.

Shut down thread pool on close().

Annotations
@Override