org.jboss.solder.exception.control
Class CaughtException<T extends Throwable>

java.lang.Object
  extended by org.jboss.solder.exception.control.CaughtException<T>
Type Parameters:
T - Exception type this event represents

public class CaughtException<T extends Throwable>
extends Object

Payload for an exception to be handled. This object is not immutable as small pieces of the state may be set by the handler.


Nested Class Summary
protected static class CaughtException.ExceptionHandlingFlow
          Flow control enum.
 
Constructor Summary
CaughtException(ExceptionStack exceptionStack, boolean breadthFirstTraversal, boolean handled)
          Initial state constructor.
 
Method Summary
 void abort()
          Instructs the dispatcher to abort further processing of handlers.
 void dropCause()
          Similar to markHandled(), but instructs the dispatcher to markHandled to the next element in the cause chain without processing additional handlers for this cause chain element.
 T getException()
           
 ExceptionStack getExceptionStack()
           
protected  CaughtException.ExceptionHandlingFlow getFlow()
           
protected  Throwable getThrowNewException()
           
 void handled()
          Instructs the dispatcher to terminate additional handler processing and mark the event as handled.
 boolean isBreadthFirstTraversal()
           
 boolean isDepthFirstTraversal()
           
 boolean isMarkedHandled()
           
protected  boolean isUnmute()
           
 void markHandled()
          Default instruction to dispatcher, continues handler processing.
 void rethrow()
          Instructs the dispatcher to rethrow the event exception after handler processing.
 void rethrow(Throwable t)
          Rethrow the exception, but use the given exception instead of the original.
 void unmute()
          Instructs the dispatcher to allow this handler to be invoked again.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CaughtException

public CaughtException(ExceptionStack exceptionStack,
                       boolean breadthFirstTraversal,
                       boolean handled)
Initial state constructor.

Parameters:
exceptionStack - Information about the current exception and cause chain.
breadthFirstTraversal - flag indicating the direction of the cause chain traversal
handled - flag indicating the exception has already been handled by a previous handler
Throws:
IllegalArgumentException - if exceptionStack is null
Method Detail

getException

public T getException()

abort

public void abort()
Instructs the dispatcher to abort further processing of handlers.


rethrow

public void rethrow()
Instructs the dispatcher to rethrow the event exception after handler processing.


handled

public void handled()
Instructs the dispatcher to terminate additional handler processing and mark the event as handled.


markHandled

public void markHandled()
Default instruction to dispatcher, continues handler processing.


dropCause

public void dropCause()
Similar to markHandled(), but instructs the dispatcher to markHandled to the next element in the cause chain without processing additional handlers for this cause chain element.


unmute

public void unmute()
Instructs the dispatcher to allow this handler to be invoked again.


isBreadthFirstTraversal

public boolean isBreadthFirstTraversal()

isDepthFirstTraversal

public boolean isDepthFirstTraversal()

isUnmute

protected boolean isUnmute()

getExceptionStack

public ExceptionStack getExceptionStack()

getFlow

protected CaughtException.ExceptionHandlingFlow getFlow()

isMarkedHandled

public boolean isMarkedHandled()

rethrow

public void rethrow(Throwable t)
Rethrow the exception, but use the given exception instead of the original.

Parameters:
t - Exception to be thrown in place of the original.

getThrowNewException

protected Throwable getThrowNewException()


Copyright © 2008-2011 Seam Framework. All Rights Reserved.