edu.rice.cs.cunit.instrumentors.threadCheck
Class AThreadCheckStrategy.SharedData

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.threadCheck.AThreadCheckStrategy.SharedData
All Implemented Interfaces:
IInstrumentationStrategy, IScannerStrategy
Enclosing class:
AThreadCheckStrategy

public static class AThreadCheckStrategy.SharedData
extends java.lang.Object
implements IScannerStrategy

Data shared among all AAddThreadCheckStrategy instances. This is an IScannerStrategy so that the warnings can be reported from a central place.


Nested Class Summary
 
Nested classes/interfaces inherited from interface edu.rice.cs.cunit.instrumentors.util.IScannerStrategy
IScannerStrategy.IScanResult
 
Field Summary
private  java.util.HashSet<BadPredicateAnnotationWarning> _badPredicateAnnotWarnings
          Warnings about badly formatted predicate annotations.
private  java.util.HashSet<ClassNotFoundWarning> _classNotFoundWarnings
          Warnings about classes that could not be found.
private  java.util.List<java.lang.String> _classPath
          List of paths to consider when searching for classes.
private  java.lang.String _currentClassName
          Name of the class currently being instrumented.
private  boolean _includePredicateMethodParameterOrder
          Update the method attribute of a @PredicateLink annotation to include the parameter order.
private  boolean _xmlConcDefFormat
          Use concurrency definitions format for output, i.e.
private  java.lang.String _xmlFileName
          File name for the XML annotations file.
 
Constructor Summary
AThreadCheckStrategy.SharedData(java.util.List<java.lang.String> parameters)
          Create a new instance of shared data.
 
Method Summary
 void addBadPredicateAnnotWarning(BadPredicateAnnotationWarning badPredicateAnnotWarning)
          Add a bad predicate annotation warning.
 void addClassNotFoundWarning(ClassNotFoundWarning classNotFoundWarning)
          Add a class not found warning.
 void done()
          Instrumentation of all classes is done.
 java.util.List<java.lang.String> getClassPath()
          Return the paths to consider when searching classes.
 java.lang.String getCurrentClassName()
          Return the name of the class currently being instrumented.
 boolean getIncludePredicateMethodParameterOrder()
          Returns true if the method attribute of a @PredicateLink annotation should be updated to include the parameter order.
 java.util.List<? extends IScannerStrategy.IScanResult> getScanResults()
          Return a list of scan results.
 java.lang.String getXmlFileName()
          Return the name of the XML annotations file.
 void instrument(ClassFile cf)
          Instrument the class.
 boolean isXmlConcDefFormat()
          Return true if the XML file should use concurrency definitions format for output, i.e.
 void setCurrentClassName(java.lang.String currentClassName)
          Set the name of the class currently being instrumented.
 void setXmlFileName(java.lang.String xmlFileName)
          Set the name of the XML annotations file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_badPredicateAnnotWarnings

private java.util.HashSet<BadPredicateAnnotationWarning> _badPredicateAnnotWarnings
Warnings about badly formatted predicate annotations.


_classNotFoundWarnings

private java.util.HashSet<ClassNotFoundWarning> _classNotFoundWarnings
Warnings about classes that could not be found.


_xmlFileName

private java.lang.String _xmlFileName
File name for the XML annotations file.


_xmlConcDefFormat

private boolean _xmlConcDefFormat
Use concurrency definitions format for output, i.e. nodes.


_classPath

private java.util.List<java.lang.String> _classPath
List of paths to consider when searching for classes.


_currentClassName

private java.lang.String _currentClassName
Name of the class currently being instrumented.


_includePredicateMethodParameterOrder

private boolean _includePredicateMethodParameterOrder
Update the method attribute of a @PredicateLink annotation to include the parameter order.

Constructor Detail

AThreadCheckStrategy.SharedData

public AThreadCheckStrategy.SharedData(java.util.List<java.lang.String> parameters)
Create a new instance of shared data.

Parameters:
parameters - parameters for the instrumentation strategy
Method Detail

getXmlFileName

public java.lang.String getXmlFileName()
Return the name of the XML annotations file.

Returns:
XML annotations file name

setXmlFileName

public void setXmlFileName(java.lang.String xmlFileName)
Set the name of the XML annotations file.

Parameters:
xmlFileName - new file name

isXmlConcDefFormat

public boolean isXmlConcDefFormat()
Return true if the XML file should use concurrency definitions format for output, i.e. nodes.

Returns:
true for

getClassPath

public java.util.List<java.lang.String> getClassPath()
Return the paths to consider when searching classes. This creates a copy, so the actual list cannot be modified.

Returns:
class path

addClassNotFoundWarning

public void addClassNotFoundWarning(ClassNotFoundWarning classNotFoundWarning)
Add a class not found warning.

Parameters:
classNotFoundWarning - warning to add

addBadPredicateAnnotWarning

public void addBadPredicateAnnotWarning(BadPredicateAnnotationWarning badPredicateAnnotWarning)
Add a bad predicate annotation warning.

Parameters:
badPredicateAnnotWarning - warning to add

getIncludePredicateMethodParameterOrder

public boolean getIncludePredicateMethodParameterOrder()
Returns true if the method attribute of a @PredicateLink annotation should be updated to include the parameter order.

Returns:
true if the method attribute should be updated

getScanResults

public java.util.List<? extends IScannerStrategy.IScanResult> getScanResults()
Return a list of scan results.

Specified by:
getScanResults in interface IScannerStrategy
Returns:
list of scan results.

instrument

public void instrument(ClassFile cf)
Instrument the class.

Specified by:
instrument in interface IInstrumentationStrategy
Parameters:
cf - class file info

getCurrentClassName

public java.lang.String getCurrentClassName()
Return the name of the class currently being instrumented.

Returns:
current class name

setCurrentClassName

public void setCurrentClassName(java.lang.String currentClassName)
Set the name of the class currently being instrumented.

Parameters:
currentClassName - new current class name

done

public void done()
Instrumentation of all classes is done.

Specified by:
done in interface IInstrumentationStrategy