Package com.arakelian.core.utils
Class ExecutorUtils
- java.lang.Object
-
- com.arakelian.core.utils.ExecutorUtils
-
public class ExecutorUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.ThreadcreateShutdownHook(java.io.Closeable closeable)static java.util.concurrent.ThreadFactorynewThreadFactory(java.lang.Class<?> clazz, boolean daemon)static java.util.concurrent.ThreadFactorynewThreadFactory(java.lang.Class<?> clazz, java.lang.String suffix, boolean daemon)static java.util.concurrent.ThreadFactorynewThreadFactory(java.lang.String format, boolean daemon)Returns a new thread factory that uses the given pattern to set the thread name.static voidremoveShutdownHook(java.lang.Thread shutdownHook)static booleanshutdown(java.util.concurrent.ExecutorService service, long timeout, java.util.concurrent.TimeUnit unit, boolean forceTermination)
-
-
-
Method Detail
-
createShutdownHook
public static java.lang.Thread createShutdownHook(java.io.Closeable closeable)
-
newThreadFactory
public static java.util.concurrent.ThreadFactory newThreadFactory(java.lang.Class<?> clazz, boolean daemon)
-
newThreadFactory
public static java.util.concurrent.ThreadFactory newThreadFactory(java.lang.Class<?> clazz, java.lang.String suffix, boolean daemon)
-
newThreadFactory
public static java.util.concurrent.ThreadFactory newThreadFactory(java.lang.String format, boolean daemon)Returns a new thread factory that uses the given pattern to set the thread name.- Parameters:
format- thread name pattern, where %d can be used to specify the thread number.daemon- true for daemon threads- Returns:
- thread factory that uses the given pattern to set the thread name
-
removeShutdownHook
public static void removeShutdownHook(java.lang.Thread shutdownHook)
-
shutdown
public static boolean shutdown(java.util.concurrent.ExecutorService service, long timeout, java.util.concurrent.TimeUnit unit, boolean forceTermination)
-
-