org.opensubsystems.core.error
Class OSSMultiException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.opensubsystems.core.error.OSSException
              extended by org.opensubsystems.core.error.OSSMultiException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
OSSInvalidDataException

public class OSSMultiException
extends OSSException

This class allows to throw multiple exceptions at once for example in scenario when we need to propagate one exception even though anothe exception has occured. This class is inspired by org.mortbay.util.MultiException from Jetty distribution.

Version:
$Id: OSSMultiException.java,v 1.7 2007/01/07 06:14:50 bastafidli Exp $
Author:
Miro Halas
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.5 2006/02/17 06:54:08 bastafidli

Field Summary
protected  java.util.List m_lstExceptions
          Excpetions which should be thrown together
 
Constructor Summary
OSSMultiException()
          Create new exception
OSSMultiException(java.lang.String message)
          Create new exception
OSSMultiException(java.lang.String message, java.lang.Throwable cause)
          Create new exception
OSSMultiException(java.lang.Throwable cause)
          Create new exception
OSSMultiException(java.lang.Throwable first, java.lang.Throwable second)
          Constructor.
 
Method Summary
 void add(java.lang.Throwable thr)
          Add new exception which should be thrown together with others.
 java.lang.Throwable initCause(java.lang.Throwable thr)
          
 void printStackTrace()
          
 void printStackTrace(java.io.PrintStream stream)
          
 void printStackTrace(java.io.PrintWriter writer)
          
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_lstExceptions

protected java.util.List m_lstExceptions
Excpetions which should be thrown together

Constructor Detail

OSSMultiException

public OSSMultiException()
Create new exception


OSSMultiException

public OSSMultiException(java.lang.String message)
Create new exception

Parameters:
message - - message to display

OSSMultiException

public OSSMultiException(java.lang.String message,
                         java.lang.Throwable cause)
Create new exception

Parameters:
message - - message to display
cause - - cause for error

OSSMultiException

public OSSMultiException(java.lang.Throwable cause)
Create new exception

Parameters:
cause - - cause for error

OSSMultiException

public OSSMultiException(java.lang.Throwable first,
                         java.lang.Throwable second)
Constructor.

Parameters:
first - - first exception which has occured
second - - second exception which has occured
Method Detail

add

public void add(java.lang.Throwable thr)
Add new exception which should be thrown together with others.

Parameters:
thr - - new exception

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Throwable

printStackTrace

public void printStackTrace()

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintStream stream)

Overrides:
printStackTrace in class java.lang.Throwable

printStackTrace

public void printStackTrace(java.io.PrintWriter writer)

Overrides:
printStackTrace in class java.lang.Throwable

initCause

public java.lang.Throwable initCause(java.lang.Throwable thr)

Overrides:
initCause in class java.lang.Throwable


Copyright © 2003 - 2006 OpenSubsystems s.r.o.