Package org.machanism.machai.gw.tools
Class CommandFunctionTools.ExecutorServiceAutoCloseable
java.lang.Object
org.machanism.machai.gw.tools.CommandFunctionTools.ExecutorServiceAutoCloseable
- All Implemented Interfaces:
AutoCloseable
- Enclosing class:
- CommandFunctionTools
private static final class CommandFunctionTools.ExecutorServiceAutoCloseable
extends Object
implements AutoCloseable
Auto-closeable wrapper for
ExecutorService so it can be used with
try-with-resources.-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateExecutorServiceAutoCloseable(ExecutorService executor) Creates a wrapper for the supplied executor service. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Shuts down the wrapped executor immediately.private ExecutorServiceget()Returns the wrapped executor service.
-
Field Details
-
executor
-
-
Constructor Details
-
ExecutorServiceAutoCloseable
Creates a wrapper for the supplied executor service.- Parameters:
executor- executor service to expose through this closeable wrapper
-
-
Method Details
-
get
Returns the wrapped executor service.- Returns:
- wrapped executor service
-
close
public void close()Shuts down the wrapped executor immediately.- Specified by:
closein interfaceAutoCloseable
-