public final class CismetConcurrency extends Object implements ShutdownHook
| Modifier and Type | Class and Description |
|---|---|
static class |
CismetConcurrency.CismetThreadFactory
Very similar to the
Executors.defaultThreadFactory() implementation. |
static class |
CismetConcurrency.LoggingAbortPolicy
An
ThreadPoolExecutor.AbortPolicy that logs a warn message (using log4j) before doing the actual handling. |
| Modifier and Type | Method and Description |
|---|---|
void |
applicationFinished()
This operation is called when the application is about to be unloaded.
|
ThreadFactory |
createThreadFactory(String prefix)
Calls
createThreadFactory(java.lang.String, java.lang.Thread.UncaughtExceptionHandler) with a null
UncaughtExceptionHandler. |
ThreadFactory |
createThreadFactory(String prefix,
Thread.UncaughtExceptionHandler excHandler)
Creates a new
CismetConcurrency.CismetThreadFactory using the ThreadGroup of this CismetConcurrency
instance, the given prefix and the given Thread.UncaughtExceptionHandler. |
ExecutorService |
getDefaultExecutor()
Getter for the default
ExecutorService for cismet applications. |
String |
getGroup()
Getter for the group name that was used to retrieve this
CismetConcurrency instance. |
static CismetConcurrency |
getInstance(String group)
Creates a new
CismetConcurrency instance for the given group or uses an already existing one. |
ThreadGroup |
getThreadGroup()
The
ThreadGroup that is used for the default executor as well as should be used for every thread/executor
created for the application group. |
public static CismetConcurrency getInstance(String group)
CismetConcurrency instance for the given group or uses an already existing one.group - the name of the group whose instance shall be returnedCismetConcurrency for the given group or null if the group is
nullpublic ExecutorService getDefaultExecutor()
ExecutorService for cismet applications. Note that this executor has a upper limit
how many tasks can be run in parallel and how many wait for the execution. This means that an exception is thrown
if the executor is fully loaded.ExecutorServiceCismetExecutors.newCachedLimitedThreadPool(int, java.util.concurrent.ThreadFactory,
java.util.concurrent.RejectedExecutionHandler)public ThreadGroup getThreadGroup()
ThreadGroup that is used for the default executor as well as should be used for every thread/executor
created for the application group.ThreadGroup of this CismetConcurrencygetInstance(java.lang.String)public String getGroup()
CismetConcurrency instance.getInstance(java.lang.String)public ThreadFactory createThreadFactory(String prefix)
createThreadFactory(java.lang.String, java.lang.Thread.UncaughtExceptionHandler) with a null
UncaughtExceptionHandler.prefix - the prefix for every thread created by this factoryThreadFactorycreateThreadFactory(java.lang.String, java.lang.Thread.UncaughtExceptionHandler)public ThreadFactory createThreadFactory(String prefix, Thread.UncaughtExceptionHandler excHandler)
CismetConcurrency.CismetThreadFactory using the ThreadGroup of this CismetConcurrency
instance, the given prefix and the given Thread.UncaughtExceptionHandler.prefix - the prefix for every thread created by this factoryexcHandler - an UncaughtExceptionHandler for the threads created by the new
ThreadFactoryThreadFactoryCismetConcurrency.CismetThreadFactorypublic void applicationFinished()
ShutdownHookapplicationFinished in interface ShutdownHookCopyright © 2012–2026 cismet GmbH. All rights reserved.