org.sape.carbon.core.exception
Interface ExceptionDelegate

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultExceptionDelegateImpl

public interface ExceptionDelegate
extends Serializable

This interface represents the responsibilities of an exception delegate in the Carbon Core exception subsystem. This system provide a simple functionality for providing special handling during the throwing of exceptions by replacing the delegate and what it does.

The contract for ExceptionDelegate implementation's is that they should expect to have ever set method called except the cause which is optional. Once that is done, the handle exception method will be called in order to allow the delegate to do any special handling or notifications it likes.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.16 $($Author: dvoet $ / $Date: 2003/05/05 21:21:21 $)
Author:
Greg Hinkle, April 2002

Method Summary
 Throwable getCause()
          Retrieves the reason thsi failed.
 Throwable getDelegatee()
          Gets the delegatee, or the exception object that is being managed by this delegate.
 Class getExceptionSource()
          The location that this exception was created.
 String getMessage()
          Gets the message for this exception.
 SeverityEnum getSeverity()
          Retrieves the harshness or how serious this failure is.
 void handleException()
          This method is called once the object is fully populated and can handle this method in many different ways such as logging it.
 void setCause(Throwable cause)
          Sets the previous exception that caused this failure to happen.
 void setDelegatee(Throwable delegatee)
          Sets the throwable which is requesting the creation of this delegate.
 void setExceptionSource(Class exceptionSource)
          Sets the location that this exception occurred..
 void setMessage(String message)
          Sets the string explanation of this exception.
 void setSeverity(SeverityEnum severity)
          Sets the harshness or how serious this failure is.
 

Method Detail

setDelegatee

public void setDelegatee(Throwable delegatee)
Sets the throwable which is requesting the creation of this delegate.

Parameters:
delegatee - the delegatee this delegate is working for

getDelegatee

public Throwable getDelegatee()
Gets the delegatee, or the exception object that is being managed by this delegate.

Returns:
the exception object that is managed by this delegate.

setMessage

public void setMessage(String message)
Sets the string explanation of this exception.

Parameters:
message - The string explanation of this exception

getMessage

public String getMessage()
Gets the message for this exception.

Returns:
the message of this exception

setCause

public void setCause(Throwable cause)
Sets the previous exception that caused this failure to happen.

Parameters:
cause - the previous failure

getCause

public Throwable getCause()
Retrieves the reason thsi failed.

Returns:
the reason for this failure.

setExceptionSource

public void setExceptionSource(Class exceptionSource)
Sets the location that this exception occurred..

Parameters:
exceptionSource - the location this exception was thrown

getExceptionSource

public Class getExceptionSource()
The location that this exception was created.

Returns:
the source location for this failure

setSeverity

public void setSeverity(SeverityEnum severity)
Sets the harshness or how serious this failure is.

Parameters:
severity - the seriousness of the failure

getSeverity

public SeverityEnum getSeverity()
Retrieves the harshness or how serious this failure is.

Returns:
the seriousness of this failure

handleException

public void handleException()
This method is called once the object is fully populated and can handle this method in many different ways such as logging it.



Copyright 1999-2003 Sapient Corporation. All Rights Reserved.