Package org.apache.dubbo.common.utils
Class ExecutorUtil
java.lang.Object
org.apache.dubbo.common.utils.ExecutorUtil
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcancelScheduledFuture(ScheduledFuture<?> scheduledFuture) static voidgracefulShutdown(Executor executor, int timeout) Use the shutdown pattern from: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.htmlstatic booleanisShutdown(Executor executor) static booleanisTerminated(Executor executor) static URLsetThreadName(URL url, String defaultName) append thread name with url addressstatic voidshutdownNow(Executor executor, int timeout)
-
Constructor Details
-
ExecutorUtil
public ExecutorUtil()
-
-
Method Details
-
isTerminated
-
isShutdown
-
gracefulShutdown
Use the shutdown pattern from: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ExecutorService.html- Parameters:
executor- the Executor to shutdowntimeout- the timeout in milliseconds before termination
-
shutdownNow
-
setThreadName
append thread name with url address- Returns:
- new url with updated thread name
-
cancelScheduledFuture
-