Package io.csar
Class DecoratedConcernedThreadGroup
java.lang.Object
java.lang.ThreadGroup
io.csar.DecoratedConcernedThreadGroup
- All Implemented Interfaces:
Concerned
,Thread.UncaughtExceptionHandler
- Direct Known Subclasses:
ConcernRegistryThreadGroup
A thread group that allows the retrieval of a concern on a per-thread-group basis by decorating an existing concerned object.
- Author:
- Garret Wilson
- See Also:
-
Constructor Summary
ConstructorDescriptionDecoratedConcernedThreadGroup
(String name, Concerned concerned) Thread group name constructor.DecoratedConcernedThreadGroup
(ThreadGroup parent, String name, Concerned concerned) Thread group parent and thread group name constructor. -
Method Summary
Modifier and TypeMethodDescriptionfindConcern
(Class<T> concernClass) Returns the concern for the given concern type.protected Concerned
Methods inherited from class java.lang.ThreadGroup
activeCount, activeGroupCount, allowThreadSuspension, checkAccess, destroy, enumerate, enumerate, enumerate, enumerate, getMaxPriority, getName, getParent, interrupt, isDaemon, isDestroyed, list, parentOf, resume, setDaemon, setMaxPriority, stop, suspend, toString, uncaughtException
-
Constructor Details
-
DecoratedConcernedThreadGroup
Thread group name constructor. Creates a thread group using the current thread as the parent.- Parameters:
name
- The name of the new thread group.concerned
- The implementation for retrieving concerns for this thread group.- Throws:
NullPointerException
- if the given concerned isnull
.SecurityException
- If the current thread cannot create a thread in the specified thread group.- See Also:
-
DecoratedConcernedThreadGroup
Thread group parent and thread group name constructor.- Parameters:
parent
- The parent thread group.name
- The name of the new thread group.concerned
- The implementation for retrieving concerns for this thread group.- Throws:
NullPointerException
- if the given parent and/or concerned isnull
.SecurityException
- If the current thread cannot create a thread in the specified thread group.- See Also:
-
-
Method Details
-
getConcerned
- Returns:
- The implementation for managing concerns for this thread group.
-
findConcern
Description copied from interface:Concerned
Returns the concern for the given concern type.- Specified by:
findConcern
in interfaceConcerned
- Type Parameters:
T
- The type of concern to retrieve.- Parameters:
concernClass
- The class of concern to retrieve.- Returns:
- The concern associated with the given class.
-