org.sape.carbon.core.exception
Class BaseException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--org.sape.carbon.core.exception.BaseException
All Implemented Interfaces:
Exceptionable, Serializable
Direct Known Subclasses:
CacheException, CarbonManagementServiceException, ConfigurationException, DeploymentServiceException, EnumNotFoundException, HomeFactoryException, MailException, MBeanServerException, StatementFactoryException, UniqueIDServiceException, UnrecoverableTaskException

public abstract class BaseException
extends Exception
implements Exceptionable

This is an abstract, base exception class provided within the Carbon Core to support basic exception functionality. This includes the tracking of cause, severity and the source of an exception as well as a string message.

Exceptions that subclass this one will attempt to log on creation when utilizing the default ExceptionDelegate. Other ExceptionDelegates may be configured by setting the carbon.exceptiondelegate system property.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.12 $($Author: dvoet $ / $Date: 2003/05/05 21:21:21 $)
Author:
Greg Hinkle, January 2002
See Also:
Serialized Form

Field Summary
protected  ExceptionDelegate delegatedException
          The implementing exception delegate that provides Carbon Core exceptions with their basic functionality.
 
Fields inherited from class java.lang.Exception
 
Fields inherited from class java.lang.Throwable
 
Constructor Summary
BaseException(Class sourceClass, String message)
          Constructs an exception with the provided source and message
BaseException(Class sourceClass, String message, Throwable cause)
          Constructs an exception with the provided source, message and cause
 
Method Summary
 Throwable getCause()
          calls getPreviousException on the delegated exception
 Class getExceptionSource()
          This method will normall return the supplied source of an exception, but may be overridden to always supply the class of the exception.
 String getMessage()
          calls getMessage on the delegated exception
abstract  SeverityEnum getSeverity()
          This method must be overriden by subclasses so that they may declare their severity
 String toString()
          calls toString on the delegated exception
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegatedException

protected ExceptionDelegate delegatedException
The implementing exception delegate that provides Carbon Core exceptions with their basic functionality.

Constructor Detail

BaseException

public BaseException(Class sourceClass,
                     String message)
Constructs an exception with the provided source and message

Parameters:
sourceClass - The source class of this exception
message - string information relating to this exception

BaseException

public BaseException(Class sourceClass,
                     String message,
                     Throwable cause)
Constructs an exception with the provided source, message and cause

Parameters:
sourceClass - The source class of this exception
message - string information relating to this exception
cause - a throwable that can be considered the cause of the current exception (used in levelizing exceptions)
Method Detail

getSeverity

public abstract SeverityEnum getSeverity()
This method must be overriden by subclasses so that they may declare their severity

Specified by:
getSeverity in interface Exceptionable
Returns:
the severity of this exception

getExceptionSource

public Class getExceptionSource()
This method will normall return the supplied source of an exception, but may be overridden to always supply the class of the exception.

Specified by:
getExceptionSource in interface Exceptionable
Returns:
the source of this exception

getCause

public Throwable getCause()
calls getPreviousException on the delegated exception

Specified by:
getCause in interface Exceptionable
Overrides:
getCause in class Throwable
Returns:
String - previousException from the delegated exception

toString

public String toString()
calls toString on the delegated exception

Overrides:
toString in class Throwable
Returns:
String - toString from the delegated exception

getMessage

public String getMessage()
calls getMessage on the delegated exception

Overrides:
getMessage in class Throwable
Returns:
String - getMessage from the delegated exception


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.