dimawo.agents
Class UncaughtThrowable

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by dimawo.agents.UncaughtThrowable
All Implemented Interfaces:
Serializable

public class UncaughtThrowable
extends Exception

Author:
Gerard Dethier A special exception class used by the agents in order to easily track the source (i.e. the component that caused the error) of the error in the context of many nested components.

This class essentially overrides stack trace printing methods in order to add to a throwable's stack trace, an additional stack representing the nesting of components identified by their name (see ErrorHandler class). For example, if a component A is nested into a component B (but may be nested into another component) and an uncaught exception is produced by the execution of component A, an UncaughtThrowable stack trace will contain informations about the fact that A is nested into B, in addition to the traditional stack trace.

See Also:
Serialized Form

Field Summary
protected  String componentName
          The name of the component that did not handle the Throwable.
protected  Throwable t
          The unhandled Throwable.
 
Constructor Summary
UncaughtThrowable(Throwable t, String childName)
          Constructs an UncaughtThrowable in function of given Throwable and component name.
 
Method Summary
 String getComponentName()
          Returns the name of the source component.
 void printStackTrace()
           
 void printStackTrace(PrintStream out)
          Prints the stack trace to the specified print stream.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

t

protected Throwable t
The unhandled Throwable.


componentName

protected String componentName
The name of the component that did not handle the Throwable.

Constructor Detail

UncaughtThrowable

public UncaughtThrowable(Throwable t,
                         String childName)
Constructs an UncaughtThrowable in function of given Throwable and component name.

Parameters:
t - The Throwable.
childName - The name of source component.
Method Detail

getComponentName

public String getComponentName()
Returns the name of the source component.

Returns:
The name of the source component.

printStackTrace

public void printStackTrace()
Overrides:
printStackTrace in class Throwable

printStackTrace

public void printStackTrace(PrintStream out)
Prints the stack trace to the specified print stream. This method is equivalent to printAgentStackTrace(out) call.

Overrides:
printStackTrace in class Throwable
See Also:
printAgentStackTrace(PrintStream)


Copyright © 2011 DiMaWo Team. All Rights Reserved.