edu.rice.cs.cunit.instrumentors.threadCheck
Class AddThreadCheckStrategy

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.threadCheck.AThreadCheckStrategy
      extended by edu.rice.cs.cunit.instrumentors.threadCheck.AAddThreadCheckStrategy
          extended by edu.rice.cs.cunit.instrumentors.threadCheck.AddThreadCheckStrategy
All Implemented Interfaces:
IInstrumentationStrategy

public class AddThreadCheckStrategy
extends AAddThreadCheckStrategy

Instrumentor to add calls to ThreadCheck.checkCurrentThreadName/Id/Group to check if the current thread is not allowed to execute a class or method.

This instrumentor checks for every method if there are @NotRunBy or @OnlyRunBy annotations attached to the method, the containing class, the same method in one of the superclasses or interfaces, or a superclass or interface, and then at the beginning of the method inserts calls to ThreadCheck..

Author:
Mathias Ricken

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.rice.cs.cunit.instrumentors.threadCheck.AAddThreadCheckStrategy
AAddThreadCheckStrategy.CacheInfo, AAddThreadCheckStrategy.OnlyAfterRealizedWarning, AAddThreadCheckStrategy.SharedAddData
 
Nested classes/interfaces inherited from class edu.rice.cs.cunit.instrumentors.threadCheck.AThreadCheckStrategy
AThreadCheckStrategy.SharedData
 
Field Summary
 
Fields inherited from class edu.rice.cs.cunit.instrumentors.threadCheck.AAddThreadCheckStrategy
_sharedAddData, XML_ANNOT_SAVE_MERGED_PREFIX
 
Fields inherited from class edu.rice.cs.cunit.instrumentors.threadCheck.AThreadCheckStrategy
_sharedData, CLASS_PATH_PARAM_PREFIX, CLASS_SIG_SEPARATOR_STRING, DEFAULT_XML_CONC_DEF_PATH_PREFIX, DEFAULT_XML_PATH_PREFIX, UPDATE_PARAM_ORDER_PREFIX, XML_ANNOT_FORMAT_PARAM, XML_ANNOT_PARAM_PREFIX
 
Constructor Summary
AddThreadCheckStrategy(AThreadCheckStrategy.SharedData shared, AAddThreadCheckStrategy.SharedAddData sharedAdd)
          Constructor for this strategy.
AddThreadCheckStrategy(java.util.List<java.lang.String> parameters, AThreadCheckStrategy.SharedData shared, AAddThreadCheckStrategy.SharedAddData sharedAdd)
          Constructor for this strategy.
 
Method Summary
 void instrument(ClassFile cf)
          Instrument the class.
 
Methods inherited from class edu.rice.cs.cunit.instrumentors.threadCheck.AAddThreadCheckStrategy
checkForSubtypingClassWarnings, checkXMLConcDef, done, extractMemberValue, extractXMLAnnotations, extractXMLConcDef, extractXMLConcDef, getClassAnnotations, getMethodAnnotations, insertCtorCall
 
Methods inherited from class edu.rice.cs.cunit.instrumentors.threadCheck.AThreadCheckStrategy
checkCombineMembers, checkPredicateMembers, checkPublicStaticIfNestedClass, extractAnnotationArray, extractLists, extractLongArray, extractPredicateSet, extractStringArray, getAnnotationClassFile, getCombineMode, getPredicateAnnotationRecord, getPredicateLink, includePredicateMethodParameterOrder, processAnnotation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddThreadCheckStrategy

public AddThreadCheckStrategy(AThreadCheckStrategy.SharedData shared,
                              AAddThreadCheckStrategy.SharedAddData sharedAdd)
Constructor for this strategy.

Parameters:
shared - data shared among all AThreadCheckStrategy instances
sharedAdd - data for all AAddThreadCheckStrategy instances

AddThreadCheckStrategy

public AddThreadCheckStrategy(java.util.List<java.lang.String> parameters,
                              AThreadCheckStrategy.SharedData shared,
                              AAddThreadCheckStrategy.SharedAddData sharedAdd)
Constructor for this strategy.

Parameters:
parameters - parameters for the instrumentors
shared - data shared among all AThreadCheckStrategy instances
sharedAdd - data for all AAddThreadCheckStrategy instances
Method Detail

instrument

public void instrument(ClassFile cf)
Instrument the class.

Parameters:
cf - class file info