- java.lang.Object
-
- com.github.akurilov.commons.concurrent.AsyncRunnableBase
-
- com.github.akurilov.commons.concurrent.DaemonBase
-
- All Implemented Interfaces:
AsyncRunnable,java.io.Closeable,java.lang.AutoCloseable
public abstract class DaemonBase extends AsyncRunnableBase
Modifies the async runnable to make sure that all instances are closed by the special method. It's useful to place the closeAll() call into the JVM's shutdown hook.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.github.akurilov.commons.concurrent.AsyncRunnable
AsyncRunnable.State
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDaemonBase()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()static voidcloseAll()
-
-
-
Method Detail
-
close
public final void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Overrides:
closein classAsyncRunnableBase- Throws:
java.io.IOException
-
closeAll
public static void closeAll()
-
-