Class ConcernedThreadGroup
- All Implemented Interfaces:
Concerned
,Thread.UncaughtExceptionHandler
- Author:
- Garret Wilson
- See Also:
-
Constructor Summary
ConstructorDescriptionConcernedThreadGroup
(String name, Concern... concerns) Thread group name and and concerns constructor.ConcernedThreadGroup
(String name, Stream<Concern> concerns) Thread group name and and concerns constructor.ConcernedThreadGroup
(ThreadGroup parent, String name, Concern... concerns) Thread group parent, thread group name, and concerns constructor.ConcernedThreadGroup
(ThreadGroup parent, String name, Stream<Concern> concerns) Thread group parent, thread group name, and concerns constructor. -
Method Summary
Modifier and TypeMethodDescriptionfindConcern
(Class<T> concernType) Returns the concern for the given concern type.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
-
ConcernedThreadGroup
Thread group name and and concerns constructor. The current thread's thread group will be used as the parent.The concerns will be accessible using
findConcern(Class)
using theConcern.getConcernType()
of each concern. If more than one concern has the same type, the latter concern has priority.- Parameters:
name
- The name of the new thread group.concerns
- The concerns to be retrievable from the thread group.- Throws:
NullPointerException
- if the given name and/or concerns isnull
.SecurityException
- If the current thread cannot create a thread in the specified thread group.- See Also:
-
ConcernedThreadGroup
Thread group name and and concerns constructor. The current thread's thread group will be used as the parent.The concerns will be accessible using
findConcern(Class)
using theConcern.getConcernType()
of each concern. If more than one concern has the same type, the latter concern has priority.- Parameters:
name
- The name of the new thread group.concerns
- The concerns to be retrievable from the thread group.- Throws:
NullPointerException
- if the given name and/or concerns isnull
.SecurityException
- If the current thread cannot create a thread in the specified thread group.- See Also:
-
ConcernedThreadGroup
public ConcernedThreadGroup(@Nonnull ThreadGroup parent, @Nonnull String name, @Nonnull Concern... concerns) Thread group parent, thread group name, and concerns constructor.The concerns will be accessible using
findConcern(Class)
using theConcern.getConcernType()
of each concern. If more than one concern has the same type, the latter concern has priority.- Parameters:
parent
- The parent thread group.name
- The name of the new thread group.concerns
- The concerns to be retrievable from the thread group.- Throws:
NullPointerException
- if the given parent thread group, name, and/or concerns isnull
.SecurityException
- If the current thread cannot create a thread in the specified thread group.- See Also:
-
ConcernedThreadGroup
public ConcernedThreadGroup(@Nonnull ThreadGroup parent, @Nonnull String name, @Nonnull Stream<Concern> concerns) Thread group parent, thread group name, and concerns constructor.The concerns will be accessible using
findConcern(Class)
using theConcern.getConcernType()
of each concern. If more than one concern has the same type, the latter concern has priority.- Parameters:
parent
- The parent thread group.name
- The name of the new thread group.concerns
- The concerns to be retrievable from the thread group.- Throws:
NullPointerException
- if the given parent thread group, name, and/or concerns isnull
.SecurityException
- If the current thread cannot create a thread in the specified thread group.- See Also:
-
-
Method Details
-
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:
concernType
- The class of concern to retrieve.- Returns:
- The concern associated with the given class.
-