Jcontract API

jcontract
Class RuntimeHandler

java.lang.Object
  |
  +--jcontract.RuntimeHandler
Direct Known Subclasses:
ExceptionRuntimeHandler, LogRuntimeHandler

public abstract class RuntimeHandler
extends java.lang.Object

Base class for all JContract Runtime Handlers.
Subclases should at least implement the contractViolated() method.


Constructor Summary
RuntimeHandler()
           
 
Method Summary
abstract  void contractViolation(java.lang.RuntimeException exception)
          Called whenever a contract is violated
 void documentedExceptionThrown(java.lang.Throwable t)
          Called whenever an exception documented with either an @exception or @throws tag is thrown
 RuntimeStatistics getRuntimeStatistics()
          Returns the accumulated RuntimeStatistics object for the RuntimeHandler
protected  void instrumentedClassLoaded(java.lang.String class_name)
          Called whenever an instrumented class is loaded
protected  void shutdownAction()
          Called when the virtual machine where this class has been loaded is about to exit
protected  void startAction()
          Called when the Runtime Handler is instantiated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RuntimeHandler

public RuntimeHandler()
Method Detail

contractViolation

public abstract void contractViolation(java.lang.RuntimeException exception)
Called whenever a contract is violated
Parameters:
exception - the exception that describes the contract violated

documentedExceptionThrown

public void documentedExceptionThrown(java.lang.Throwable t)
Called whenever an exception documented with either an @exception or @throws tag is thrown
Parameters:
t - the exception being thrown

getRuntimeStatistics

public final RuntimeStatistics getRuntimeStatistics()
Returns the accumulated RuntimeStatistics object for the RuntimeHandler

instrumentedClassLoaded

protected void instrumentedClassLoaded(java.lang.String class_name)
Called whenever an instrumented class is loaded
Parameters:
class_name - name of the class being loaded

shutdownAction

protected void shutdownAction()
Called when the virtual machine where this class has been loaded is about to exit

startAction

protected void startAction()
Called when the Runtime Handler is instantiated

Jcontract API