korat.instrumentation
Class InstrumentationManager

java.lang.Object
  extended by korat.instrumentation.InstrumentationManager

public class InstrumentationManager
extends Object

The place for various constants, utility method and such related to instrumentation. This is also the place for obtaining the currently configured instrumenter, which should be used throughout the program (by the class loader before loading the class, for example).

Author:
Aleksandar Milicevic
See Also:
IInstrumenter, AbstractInstrumenter

Field Summary
static String _KORAT_ARRAY_FIELD_PREFIX
           
protected static Set<CtClass> alreadyInstrumented
          global repository of the instrumented classes
static String GETSETTER_TEMPLATE
           
static String GETTER_PREFIX
           
static String ID_FIELD_PREFIX
           
private static AbstractInstrumenter instrumenter
           
static String KORAT_FIELD_PREFIX
           
static String SETTER_TEMPLATE
           
static String SETTER_THIS_FIELD_NAME
           
static String TESTER_FIELD_NAME
           
 
Constructor Summary
InstrumentationManager()
           
 
Method Summary
static void addToAlreadyInstrumented(CtClass clz)
           
static String getGetSetterName(String fieldName)
           
static String getGetterName(String fieldName)
           
static String getIdFieldName(String fieldName)
           
static IInstrumenter getInstrumenter()
           
static String getKoratArrayFieldName(String fName)
          For the given array field name returns the name of the corresponding KoratArray field.
static String getSetterClassName(String fieldName)
           
protected static void instrumentClassIfNeeded(CtClass clz)
          Instruments the given class if not already instrumented
static boolean isKoratField(String fieldName)
           
static boolean isKoratMethod(String methodName)
           
static void loadAllClasses(ClassLoader cl)
          Loads all instrumented classes using class loader cl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

instrumenter

private static AbstractInstrumenter instrumenter

alreadyInstrumented

protected static Set<CtClass> alreadyInstrumented
global repository of the instrumented classes


KORAT_FIELD_PREFIX

public static final String KORAT_FIELD_PREFIX
See Also:
Constant Field Values

TESTER_FIELD_NAME

public static final String TESTER_FIELD_NAME
See Also:
Constant Field Values

ID_FIELD_PREFIX

public static final String ID_FIELD_PREFIX
See Also:
Constant Field Values

GETTER_PREFIX

public static final String GETTER_PREFIX
See Also:
Constant Field Values

SETTER_THIS_FIELD_NAME

public static final String SETTER_THIS_FIELD_NAME
See Also:
Constant Field Values

SETTER_TEMPLATE

public static final String SETTER_TEMPLATE
See Also:
Constant Field Values

GETSETTER_TEMPLATE

public static final String GETSETTER_TEMPLATE
See Also:
Constant Field Values

_KORAT_ARRAY_FIELD_PREFIX

public static final String _KORAT_ARRAY_FIELD_PREFIX
See Also:
Constant Field Values
Constructor Detail

InstrumentationManager

public InstrumentationManager()
Method Detail

getInstrumenter

public static IInstrumenter getInstrumenter()

addToAlreadyInstrumented

public static void addToAlreadyInstrumented(CtClass clz)

instrumentClassIfNeeded

protected static void instrumentClassIfNeeded(CtClass clz)
                                       throws CannotCompileException,
                                              NotFoundException,
                                              IOException
Instruments the given class if not already instrumented

Parameters:
clz - class to instrument
Throws:
CannotCompileException
NotFoundException
IOException

loadAllClasses

public static void loadAllClasses(ClassLoader cl)
Loads all instrumented classes using class loader cl

Parameters:
cl -

isKoratField

public static boolean isKoratField(String fieldName)
Parameters:
fieldName - - field name
Returns:
is the field with the given name one of the special fields introduced by Korat.

isKoratMethod

public static boolean isKoratMethod(String methodName)
Parameters:
methodName - - method name
Returns:
is the method with the given name one of the special methods introduced by Korat.

getGetterName

public static String getGetterName(String fieldName)

getIdFieldName

public static String getIdFieldName(String fieldName)

getGetSetterName

public static String getGetSetterName(String fieldName)

getSetterClassName

public static String getSetterClassName(String fieldName)

getKoratArrayFieldName

public static String getKoratArrayFieldName(String fName)
For the given array field name returns the name of the corresponding KoratArray field.

Parameters:
fName - name of the array field
Returns:
name of the corresponding KoratArray field