fr.emn.info.eaop.instrumentation
Class SelectiveInstrumentation

java.lang.Object
  |
  +--fr.emn.info.eaop.instrumentation.SelectiveInstrumentation

public class SelectiveInstrumentation
extends java.lang.Object

Class enabling the selective instrumentation of source code (base and aspects) with event generation statements and calls to the monitor. This class provides three functionalities:

  1. Restriction of the instrumentation to specific classes (method checkClass), and methods or constructors (checkMethodOrConstructor).
    Attention: there are similar but different class-related and method-related predicates (e.g. matchClassName vs. matchMethodClassName).
  2. Definition of aspects (as defined by checkAspect) which are to be instrumented.
  3. Definition of the set of user-defined files (field files) constituting the EAOP application.
An EAOP application may use these functionalities by defining a class inheriting from this class, defining fields and redefining the methods provided as needed using the predicates provided.

Version:
1.0
Author:
MS

Field Summary
 java.lang.String[] files
           
protected  recoder.java.declaration.MethodDeclaration md
           
protected  recoder.java.declaration.TypeDeclaration td
           
 
Constructor Summary
SelectiveInstrumentation()
           
 
Method Summary
protected  boolean checkAspect(recoder.java.declaration.TypeDeclaration td)
          Predicate discriminating aspects which are visible by other aspects.
protected  boolean checkClass(recoder.java.declaration.TypeDeclaration td)
          Predicate discriminating classes to be instrumented.
protected  boolean checkMethodOrConstructor(recoder.java.declaration.MethodDeclaration md)
          Predicate discriminating methods and constructors to be instrumented.
 java.lang.String[] getFiles()
           
protected  boolean isAspectInstance()
           
protected  boolean isSystemMethodOrConstructor()
           
protected  boolean matchClassName(java.lang.String regexp)
           
protected  boolean matchFieldNames(java.lang.String regexp)
           
protected  boolean matchMethodClassName(java.lang.String regexp)
           
protected  boolean matchMethodName(java.lang.String regexp)
           
protected  boolean matchMethodNames(java.lang.String regexp)
           
protected  boolean matchMethodPackage(java.lang.String regexp)
           
protected  boolean matchPackage(java.lang.String regexp)
           
protected  boolean matchParameterTypes(java.lang.String regexp)
           
protected  boolean matchReturnType(java.lang.String regexp)
           
protected  boolean matchSupertypeNames(recoder.list.ClassTypeList cts, java.lang.String regexp)
           
protected  boolean matchSupertypeNames(java.lang.String regexp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

td

protected recoder.java.declaration.TypeDeclaration td

md

protected recoder.java.declaration.MethodDeclaration md

files

public java.lang.String[] files
Constructor Detail

SelectiveInstrumentation

public SelectiveInstrumentation()
Method Detail

checkClass

protected boolean checkClass(recoder.java.declaration.TypeDeclaration td)
Predicate discriminating classes to be instrumented.


checkMethodOrConstructor

protected boolean checkMethodOrConstructor(recoder.java.declaration.MethodDeclaration md)
Predicate discriminating methods and constructors to be instrumented.


checkAspect

protected boolean checkAspect(recoder.java.declaration.TypeDeclaration td)
Predicate discriminating aspects which are visible by other aspects.


matchClassName

protected boolean matchClassName(java.lang.String regexp)

matchFieldNames

protected boolean matchFieldNames(java.lang.String regexp)

matchMethodNames

protected boolean matchMethodNames(java.lang.String regexp)

matchSupertypeNames

protected boolean matchSupertypeNames(java.lang.String regexp)

matchSupertypeNames

protected boolean matchSupertypeNames(recoder.list.ClassTypeList cts,
                                      java.lang.String regexp)

matchPackage

protected boolean matchPackage(java.lang.String regexp)

isAspectInstance

protected boolean isAspectInstance()

matchMethodClassName

protected boolean matchMethodClassName(java.lang.String regexp)

matchMethodName

protected boolean matchMethodName(java.lang.String regexp)

matchMethodPackage

protected boolean matchMethodPackage(java.lang.String regexp)

matchParameterTypes

protected boolean matchParameterTypes(java.lang.String regexp)

matchReturnType

protected boolean matchReturnType(java.lang.String regexp)

isSystemMethodOrConstructor

protected boolean isSystemMethodOrConstructor()

getFiles

public java.lang.String[] getFiles()