alt.jiapi.event
Class ExceptionEventProducer

java.lang.Object
  extended by alt.jiapi.event.EventProducer
      extended by alt.jiapi.event.ExceptionEventProducer

public class ExceptionEventProducer
extends EventProducer

This class registers itself to Jiapi runtime and tracks Exception related events. When such an event happens, each registered listener will notified.

Version:
$Revision: 1.11 $ $Date: 2010/02/19 08:39:30 $
Author:
Mika Riekkinen, Joni Suominen

Constructor Summary
ExceptionEventProducer(InstrumentationDescriptor id)
          Constructor.
ExceptionEventProducer(InstrumentationDescriptor id, java.lang.String resolution)
          Constructor.
 
Method Summary
 void addExceptionListener(ExceptionListener fl)
          Adds a ExceptionListener.
 void catchTrapped(java.lang.Object sourceObject, java.lang.String exceptionName)
          This method is called by the Jiapi runtime.
 void catchTrapped(java.lang.Object sourceObject, java.lang.String exceptionName, java.lang.Object target)
          This method is called by the Jiapi runtime.
protected  void fireCatchEvent(java.lang.Object sourceObject, java.lang.String exceptionName, java.lang.Object target)
          Fires an event when exception has been caught.
 void removeExceptionListener(ExceptionListener fl)
          Removes a ExceptionListener.
 
Methods inherited from class alt.jiapi.event.EventProducer
getResolutions, isProtected, isProtected, match, protect, release
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionEventProducer

public ExceptionEventProducer(InstrumentationDescriptor id)
Constructor. Resolution is set to '*', which indicates all the ExceptionEvents are produced.

Parameters:
id - Instrumentation decsriptor, that this ExceptionEventProducer registers itself to.

ExceptionEventProducer

public ExceptionEventProducer(InstrumentationDescriptor id,
                              java.lang.String resolution)
Constructor. Only ExceptionEvents, that match with resolution, are produced. Resolution is compared against the name of the Exception during instrumentation. Name of the Exception is exactly the same, as it is given in Java source code in catch(....) statement. This means, that if one is catching java.lang.Exception, and java.lang.ClassNotFoundException is trapped, the former is used in resolution comparison.

Parameters:
id - Instrumentation decsriptor, that this ExceptionEventProducer registers itself to.
resolution - Resolution, that is used further to select which Exceptions will trigger events to be produced.
Method Detail

addExceptionListener

public void addExceptionListener(ExceptionListener fl)
Adds a ExceptionListener.

Parameters:
fl - a ExceptionListener

catchTrapped

public void catchTrapped(java.lang.Object sourceObject,
                         java.lang.String exceptionName)
This method is called by the Jiapi runtime. It should not be called by others.


catchTrapped

public void catchTrapped(java.lang.Object sourceObject,
                         java.lang.String exceptionName,
                         java.lang.Object target)
This method is called by the Jiapi runtime. It should not be called by others.


fireCatchEvent

protected void fireCatchEvent(java.lang.Object sourceObject,
                              java.lang.String exceptionName,
                              java.lang.Object target)
Fires an event when exception has been caught.

Parameters:
target - Target object
methodName - Name of the method

removeExceptionListener

public void removeExceptionListener(ExceptionListener fl)
Removes a ExceptionListener.

Parameters:
fl - a ExceptionListener


Copyright © 2001. Documenation generated August 26 2011.