Package de.gsi.dataset.utils
Class AggregateException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- de.gsi.dataset.utils.AggregateException
-
- All Implemented Interfaces:
java.io.Serializable
public class AggregateException extends java.lang.RuntimeExceptionSimple aggregation of exceptions (used for catching exceptions of parallel executions)- Author:
- rstein
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static interfaceAggregateException.PrintStreamOrWriterWrapper class for PrintStream and PrintWriter to enable a single implementation of printStackTrace.protected static classAggregateException.WrappedPrintStreamprotected static classAggregateException.WrappedPrintWriter
-
Constructor Summary
Constructors Constructor Description AggregateException(java.lang.String message)AggregateException(java.lang.String message, java.util.List<java.lang.Throwable> throwables)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(java.lang.Throwable cause)java.lang.ThrowablegetCause()java.util.List<java.lang.Throwable>getThrowableList()booleanisEmpty()protected static voidprintEnclosedStackTrace(java.lang.Throwable throwable, AggregateException.PrintStreamOrWriter stream, java.lang.StackTraceElement[] enclosingTrace, java.lang.String caption, java.lang.String prefix, java.util.Set<java.lang.Throwable> dejaVu)Print our stack trace as an enclosed exception for the specified stack trace.voidprintStackTrace(java.io.PrintStream s)Prints this throwable and its backtrace to the specified print stream.
-
-
-
Method Detail
-
add
public void add(java.lang.Throwable cause)
-
getCause
public java.lang.Throwable getCause()
- Overrides:
getCausein classjava.lang.Throwable
-
getThrowableList
public java.util.List<java.lang.Throwable> getThrowableList()
- Returns:
- the throwableList
-
isEmpty
public boolean isEmpty()
- Returns:
- whether exception aggregated multiple exceptions
-
printStackTrace
public void printStackTrace(java.io.PrintStream s)
Prints this throwable and its backtrace to the specified print stream.- Overrides:
printStackTracein classjava.lang.Throwable- Parameters:
s-PrintStreamto use for output
-
printEnclosedStackTrace
protected static void printEnclosedStackTrace(java.lang.Throwable throwable, AggregateException.PrintStreamOrWriter stream, java.lang.StackTraceElement[] enclosingTrace, java.lang.String caption, java.lang.String prefix, java.util.Set<java.lang.Throwable> dejaVu)Print our stack trace as an enclosed exception for the specified stack trace.- Parameters:
throwable- the throwable to be printed/dived-intostream- the output stream to write toenclosingTrace- from the previous exception instancecaption- to specify the stack trace contextprefix- line formatting prefixdejaVu- to detect circular references
-
-