public class BugReportQueue extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private class |
BugReportQueue.BugReportDisplayRunnable |
static class |
BugReportQueue.SuppressionMode
The suppression mode that should be used after the dialog was closed.
|
Modifier and Type | Field and Description |
---|---|
private java.util.function.BiFunction<ReportedException,java.lang.Integer,BugReportQueue.SuppressionMode> |
bugReportHandler |
private int |
displayedErrors |
private java.lang.Thread |
displayThread |
private java.util.concurrent.CopyOnWriteArrayList<java.util.function.Predicate<ReportedException>> |
handlers |
private boolean |
inReportDialog |
private static BugReportQueue |
INSTANCE |
private java.util.LinkedList<ReportedException> |
reportsToDisplay |
private boolean |
suppressAllMessages |
private java.util.ArrayList<ReportedException> |
suppressFor |
Constructor and Description |
---|
BugReportQueue() |
Modifier and Type | Method and Description |
---|---|
void |
addBugReportHandler(java.util.function.Predicate<ReportedException> handler)
Allows you to peek or even intersect the bug reports.
|
private BugReportQueue.SuppressionMode |
displayFor(ReportedException e) |
boolean |
exceptionHandlingInProgress()
Check if the dialog is shown.
|
private static java.util.function.BiFunction<ReportedException,java.lang.Integer,BugReportQueue.SuppressionMode> |
getBestHandler() |
private int |
getDisplayedErrors() |
static BugReportQueue |
getInstance()
Gets the global bug report queue
|
private ReportedException |
getNext() |
private void |
handleDialogResult(ReportedException e,
BugReportQueue.SuppressionMode suppress) |
void |
submit(ReportedException report)
Submit a new error to be displayed
|
private static final BugReportQueue INSTANCE
private final java.util.LinkedList<ReportedException> reportsToDisplay
private boolean suppressAllMessages
private final java.util.ArrayList<ReportedException> suppressFor
private java.lang.Thread displayThread
private final java.util.function.BiFunction<ReportedException,java.lang.Integer,BugReportQueue.SuppressionMode> bugReportHandler
private final java.util.concurrent.CopyOnWriteArrayList<java.util.function.Predicate<ReportedException>> handlers
private int displayedErrors
private boolean inReportDialog
public BugReportQueue()
public void submit(ReportedException report)
report
- The error to displayprivate void handleDialogResult(ReportedException e, BugReportQueue.SuppressionMode suppress)
private ReportedException getNext() throws java.lang.InterruptedException
java.lang.InterruptedException
private BugReportQueue.SuppressionMode displayFor(ReportedException e)
private int getDisplayedErrors()
public boolean exceptionHandlingInProgress()
true
if the exception handler is still showing the exception to the user.private static java.util.function.BiFunction<ReportedException,java.lang.Integer,BugReportQueue.SuppressionMode> getBestHandler()
public void addBugReportHandler(java.util.function.Predicate<ReportedException> handler)
handler
- The handler. It can return false to stop all further handling of the exception.public static BugReportQueue getInstance()