DESY ACOP Beans Home

com.cosylab.util
Class CombinedException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by com.cosylab.util.CommonException
              extended by com.cosylab.util.CombinedException
All Implemented Interfaces:
CommonThrowable, java.io.Serializable

public class CombinedException
extends CommonException

CombinedException holds together association of exception, which was for some reason thrown together. For example when a operation is made on set of object in same hirarchical level and some of them throw exception. These exceptions should be collected and associated and reethrown as single CombinedException.

NOTE! instances of this class are not synchronized. In case more threads is addind exceptions, htan programmer must provide own synchronization.

Version:
$id$
Author:
Igor Kriznar
See Also:
CommonException, Serialized Form

Field Summary
protected  java.util.ArrayList collected
           
 
Fields inherited from class com.cosylab.util.CommonException
actions, caughtIn, helpID, host, instance, thread, timestamp, username, values
 
Constructor Summary
protected CombinedException()
          Create a new instance of CombinedException.
  CombinedException(java.lang.Object instance, java.lang.String s)
          Create an instance of CombinedException with a with a specified message string.
  CombinedException(java.lang.Object instance, java.lang.String message, java.lang.Throwable t)
          Create an instance of CombinedException by specifying both the string message and a Throwable object that represents the nested exception.
 
Method Summary
 void associateException(java.lang.Throwable throwble)
          Associates parameter throwable to this exception.
 java.lang.Throwable[] getAssociatedExceptions()
          Returns exceptions associated with this object.
 void printStackTrace(java.io.PrintStream s)
          DOCUMENT ME!
 
Methods inherited from class com.cosylab.util.CommonException
caughtIn, getActions, getCaughtIn, getHelpID, getHost, getInstance, getParent, getThread, getTimestamp, getUsername, getValue, getValues, initialize, putValue, setActions, setHelpID
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.cosylab.util.CommonThrowable
getMessage
 

Field Detail

collected

protected java.util.ArrayList collected
Constructor Detail

CombinedException

protected CombinedException()
Create a new instance of CombinedException. This constructor should normally not be used since it carries no additional exception data.


CombinedException

public CombinedException(java.lang.Object instance,
                         java.lang.String s)
Create an instance of CombinedException with a with a specified message string. The construction is delegated to super.

Parameters:
instance - identifier of the instance throwing this exception
s - message to be printed together with the exception type when the toString() is called.

CombinedException

public CombinedException(java.lang.Object instance,
                         java.lang.String message,
                         java.lang.Throwable t)
Create an instance of CombinedException by specifying both the string message and a Throwable object that represents the nested exception.

Parameters:
instance - identifier of the instance throwing this exception
message - a string message passed to super
t - an instance of Throwable that caused this to be thrown, can be null
Method Detail

associateException

public void associateException(java.lang.Throwable throwble)
Associates parameter throwable to this exception.

Parameters:
throwble - exception to be associated

getAssociatedExceptions

public java.lang.Throwable[] getAssociatedExceptions()
Returns exceptions associated with this object.

Returns:
exceptions associated with this object

printStackTrace

public void printStackTrace(java.io.PrintStream s)
DOCUMENT ME!

Overrides:
printStackTrace in class java.lang.Throwable
Parameters:
s - DOCUMENT ME!


Copyright © 2010. All Rights Reserved.