com.sdm.quasar.client.core.common
Class DisposeException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended bycom.sdm.quasar.client.core.common.DisposeException
All Implemented Interfaces:
java.io.Serializable

public class DisposeException
extends java.lang.RuntimeException

Signifies that one or more errors occurred while executing a Disposable.dispose() method. This exception allows to collects these errors to allow for a very robust implementation of Disposable.dispose() that frees as many resources as possible while still retaining information about the errors that occured during the execution.

Version:
1.0
Author:
Bernd Olleck, sd&m AG
See Also:
Serialized Form

Nested Class Summary
static class DisposeException.MessageAndCause
          Wrapper class for a message (String) and a cause (Throwable).
 
Constructor Summary
DisposeException()
          Constructor.
DisposeException(java.lang.String message)
          Creates a DisposeException with an initial message.
DisposeException(java.lang.String message, java.lang.Throwable cause)
          Creates a DisposeException with an initial cause.
DisposeException(java.lang.Throwable cause)
          Creates a DisposeException with an initial cause.
 
Method Summary
 void addCause(java.lang.Throwable cause)
          Adds an exception to this DisposeException.
 void addMessage(java.lang.String message)
          Adds a message without an exception this DisposeException.
 void addMessageAndCause(java.lang.String message, java.lang.Throwable cause)
          Adds a message and an exception to this DisposeException.
 void addMessageAndCauses(DisposeException.MessageAndCause[] messagesAndCauses)
          Adds the given messages and their causes to this DisposeException.
 java.lang.String getMessage()
          Adds a note to the message obtained by the super call if multiple causes exist.
 DisposeException.MessageAndCause[] getMessagesAndCauses()
          Returns the messages and causes included in this destruction exception.
 void printStackTrace(java.io.PrintStream s)
          Adds the multiple stored causes to the output generated by the call to super.
 void printStackTrace(java.io.PrintWriter s)
          Adds the multiple stored causes to the output generated by the call to super.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DisposeException

public DisposeException()
Constructor. Creates a DisposeException without an initial cause.


DisposeException

public DisposeException(java.lang.String message)
Creates a DisposeException with an initial message. The message is included in the list of messages and causes (getMessagesAndCauses()).

Parameters:
message - the initial message

DisposeException

public DisposeException(java.lang.Throwable cause)
Creates a DisposeException with an initial cause. The cause is included in the list of messages and causes (getMessagesAndCauses()).

Parameters:
cause - the inital cause

DisposeException

public DisposeException(java.lang.String message,
                        java.lang.Throwable cause)
Creates a DisposeException with an initial cause. The message and cause is included in the list of messages and causes (getMessagesAndCauses()).

Parameters:
message - the message for the initial cause
cause - the inital cause
Method Detail

addMessageAndCause

public void addMessageAndCause(java.lang.String message,
                               java.lang.Throwable cause)
Adds a message and an exception to this DisposeException. The message and cause is included in the list of messages and causes (getMessagesAndCauses()).

Parameters:
message - the message for the exception
cause - the exception

addMessageAndCauses

public void addMessageAndCauses(DisposeException.MessageAndCause[] messagesAndCauses)
Adds the given messages and their causes to this DisposeException.

Parameters:
messagesAndCauses - the array of DisposeException.MessageAndCause to add

addCause

public void addCause(java.lang.Throwable cause)
Adds an exception to this DisposeException. The cause is included in the list of messages and causes (getMessagesAndCauses()).

Parameters:
cause - the exception

addMessage

public void addMessage(java.lang.String message)
Adds a message without an exception this DisposeException. The message is included in the list of messages and causes (getMessagesAndCauses()).

Parameters:
message - the message

getMessagesAndCauses

public DisposeException.MessageAndCause[] getMessagesAndCauses()
Returns the messages and causes included in this destruction exception.

Returns:
the messages and causes included in this destruction exception.

getMessage

public java.lang.String getMessage()
Adds a note to the message obtained by the super call if multiple causes exist.

Returns:
the message

printStackTrace

public void printStackTrace(java.io.PrintStream s)
Adds the multiple stored causes to the output generated by the call to super.


printStackTrace

public void printStackTrace(java.io.PrintWriter s)
Adds the multiple stored causes to the output generated by the call to super.