public class Advisory extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Advisory.AdvisoryGroup
AdvisoryGroup instance is associated with a number of Threads and is abstractly associated with some particular job (which is potentially multi-threaded).
AdvisoryGroup class is thread-safe. |
static class |
Advisory.AdvisoryMessage
AdvisoryMessage is an abstraction of a message with a possible Throwable cause.
|
| Constructor and Description |
|---|
Advisory() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
addMessageIfLinked(String message)
Returns true if Thread.currentThread() is linked to an AdvisoryGroup (also creates AdvisoryMessage and adds it to that group).
Otherwise returns false. |
static List<String> |
compileAdvisoryMessages(Advisory.AdvisoryGroup agroup)
Compiles a list of AdvisoryMessage texts, including messages of any Throwable causes of those AdvisoryMessages, for the provided AdvisoryGroup.
|
static List<String> |
compileAdvisoryMessagesForCurrentThreadGroup()
Compiles a list of AdvisoryMessage texts, including messages of any Throwable causes of those AdvisoryMessages, for the AdvisoryGroup linked to Thread.currentThread().
|
static void |
destroy(Advisory.AdvisoryGroup aGroup)
Destroys an AdvisoryGroup and breaks links to other objects.
|
static Advisory.AdvisoryGroup |
getCurrentThreadGroup()
Returns AdvisoryGroup to which Thread.currentThread() is linked to, or null.
|
static Advisory.AdvisoryGroup |
getGroupByKey(Object key)
Returns an AdvisoryGroup instance for the provided key.
If no AdvisoryGroup exists for this key, it is created and then returned. |
static Advisory.AdvisoryGroup |
getGroupByThread(Thread thread)
Returns AdvisoryGroup to which the provided Thread is linked to is linked to, or null.
|
public static Advisory.AdvisoryGroup getGroupByKey(Object key)
key - The key to uniquely identify the AdvisoryGroup. For example, a process ID or an ID of one of parallel jobs.public static Advisory.AdvisoryGroup getCurrentThreadGroup()
public static Advisory.AdvisoryGroup getGroupByThread(Thread thread)
thread - Thread to check if linked to an AdvisoryGrouppublic static void destroy(Advisory.AdvisoryGroup aGroup)
aGroup - AdvisoryGroup to destroypublic static boolean addMessageIfLinked(String message)
message - text for the AdvisoryMessagepublic static List<String> compileAdvisoryMessagesForCurrentThreadGroup()
public static List<String> compileAdvisoryMessages(Advisory.AdvisoryGroup agroup)
agroup - AdvisoryGroup to compile messages fromCopyright © 2022. All rights reserved.