Class ThreadService
java.lang.Object
ecmwf.common.technical.ThreadService
The Class ThreadService.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe Class ConfigurableLoopRunnable.static classThe Class ConfigurableRunnable. -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorServicegetCleaningThreadLocalExecutorService(int nThreads, boolean useVirtualThreads, boolean daemonThreads) Gets the cleaning thread local executor service.static StringGets the cookie.static ExecutorServicegetSingleCleaningThreadLocalExecutorService(boolean useVirtualThreads, boolean daemonThreads) Gets the single cleaning thread local executor service.static voidRemoves the cookie.static voidSets the cookie.static booleanSets the cookie if not already set.
-
Method Details
-
getCleaningThreadLocalExecutorService
public static ExecutorService getCleaningThreadLocalExecutorService(int nThreads, boolean useVirtualThreads, boolean daemonThreads) Gets the cleaning thread local executor service.- Parameters:
nThreads- the n threadsuseVirtualThreads- the use virtual threadsdaemonThreads- the daemon threads- Returns:
- the executor service
-
getSingleCleaningThreadLocalExecutorService
public static ExecutorService getSingleCleaningThreadLocalExecutorService(boolean useVirtualThreads, boolean daemonThreads) Gets the single cleaning thread local executor service.- Parameters:
useVirtualThreads- the use virtual threadsdaemonThreads- the daemon threads- Returns:
- the executor service
-
setCookieIfNotAlreadySet
Sets the cookie if not already set.- Parameters:
name- the name- Returns:
- true, if successful
-
setCookie
-
removeCookie
public static void removeCookie()Removes the cookie. -
getCookie
-