Class AggregateException

  • All Implemented Interfaces:
    java.io.Serializable

    public class AggregateException
    extends java.lang.RuntimeException
    Simple aggregation of exceptions (used for catching exceptions of parallel executions)
    Author:
    rstein
    See Also:
    Serialized Form
    • 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
      void add​(java.lang.Throwable cause)  
      java.lang.Throwable getCause()  
      java.util.List<java.lang.Throwable> getThrowableList()  
      boolean isEmpty()  
      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.
      void printStackTrace​(java.io.PrintStream s)
      Prints this throwable and its backtrace to the specified print stream.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • AggregateException

        public AggregateException​(java.lang.String message)
      • AggregateException

        public AggregateException​(java.lang.String message,
                                  java.util.List<java.lang.Throwable> throwables)
    • Method Detail

      • add

        public void add​(java.lang.Throwable cause)
      • getCause

        public java.lang.Throwable getCause()
        Overrides:
        getCause in class java.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:
        printStackTrace in class java.lang.Throwable
        Parameters:
        s - PrintStream to 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-into
        stream - the output stream to write to
        enclosingTrace - from the previous exception instance
        caption - to specify the stack trace context
        prefix - line formatting prefix
        dejaVu - to detect circular references