de.uka.ipd.sdq.ByCounter.execution
Class ExecutionSettings

java.lang.Object
  extended by de.uka.ipd.sdq.ByCounter.execution.ExecutionSettings
All Implemented Interfaces:
java.lang.Cloneable

public class ExecutionSettings
extends java.lang.Object
implements java.lang.Cloneable

This class holds a collection of settings that relate to the execution of instrumented Java byte code and the details of counting or aggregating the instrumentation results.

Author:
Martin Krogmann

Field Summary
static java.util.Set<java.lang.String> INTERNAL_CLASSES_DEFINITION_DEFAULT
          Default value of getInternalClassesDefinition().
static char INTERNAL_CLASSES_DEFINITION_WILDCARD_CHAR
          This character ('42') is used in the definition of internal classes.
static java.lang.ClassLoader PARENT_CLASS_LOADER_DEFAULT
          Default value for getParentClassLoader().
 
Constructor Summary
ExecutionSettings()
          Construct ExecutionSettings by setting every field to it's default value.
 
Method Summary
 ExecutionSettings clone()
           
 boolean getAddUpResultsRecursively()
           
 CountingResultCollectorMode getCountingResultCollectorMode()
           
 java.util.Set<java.lang.String> getInternalClassesDefinition()
           
 java.lang.ClassLoader getParentClassLoader()
           
 boolean isInternalClass(java.lang.String qualifyingMethodName)
          Uses getInternalClassesDefinition() to decide whether the given name is considered an internal class.
 void setAddUpResultsRecursively(boolean addUpResultsRecursively)
           
 void setCountingResultCollectorMode(CountingResultCollectorMode countingResultCollectorMode)
           
 void setInternalClassesDefinition(java.util.Set<java.lang.String> internalClassesDefinition)
           
 void setParentClassLoader(java.lang.ClassLoader parentClassLoader)
          This is used for instantiation of classes that are set to execute.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INTERNAL_CLASSES_DEFINITION_WILDCARD_CHAR

public static final char INTERNAL_CLASSES_DEFINITION_WILDCARD_CHAR
This character ('42') is used in the definition of internal classes.

See Also:
setInternalClassesDefinition(Set), Constant Field Values

INTERNAL_CLASSES_DEFINITION_DEFAULT

public static final java.util.Set<java.lang.String> INTERNAL_CLASSES_DEFINITION_DEFAULT
Default value of getInternalClassesDefinition().


PARENT_CLASS_LOADER_DEFAULT

public static final java.lang.ClassLoader PARENT_CLASS_LOADER_DEFAULT
Default value for getParentClassLoader().

Constructor Detail

ExecutionSettings

public ExecutionSettings()
Construct ExecutionSettings by setting every field to it's default value.

Method Detail

clone

public ExecutionSettings clone()
Overrides:
clone in class java.lang.Object

isInternalClass

public boolean isInternalClass(java.lang.String qualifyingMethodName)
Uses getInternalClassesDefinition() to decide whether the given name is considered an internal class.

Parameters:
qualifyingMethodName - Name of the class to check.
Returns:
True when the class is internal.

setInternalClassesDefinition

public void setInternalClassesDefinition(java.util.Set<java.lang.String> internalClassesDefinition)
Parameters:
internalClassesDefinition - The definition of internal classes. When adding up results when retrieving results recursively, this definition allows for adding up only results for classes defined as internal. A value of null means all classes are considered internal.

For each string, specifying a '42' at the end enables prefix matching, i.e. all classes with the prefix are matched. If a string specifies a class name, non-public/internal classes are also considered internal.

Examples:

  • de.uka42 matches de.ukap.Test, de.uka.ipd, ...
  • de.uka.Test matches de.uka.Test, de.uka.Test$XXX, de.uka.Test$XXX$YYY, ...
  • de.uka.Test matches de.uka.Test, but not de.uka.Test.{ENUM Y}

  • getInternalClassesDefinition

    public java.util.Set<java.lang.String> getInternalClassesDefinition()
    Returns:
    The definition of internal classes.
    See Also:
    setInternalClassesDefinition(Set)

    getCountingResultCollectorMode

    public CountingResultCollectorMode getCountingResultCollectorMode()
    Returns:
    The mode in which the CountingResultCollector operates.

    setCountingResultCollectorMode

    public void setCountingResultCollectorMode(CountingResultCollectorMode countingResultCollectorMode)
    Parameters:
    countingResultCollectorMode - The mode in which the CountingResultCollector operates.

    getAddUpResultsRecursively

    public boolean getAddUpResultsRecursively()
    Returns:
    True, when result retrieval adds up counting results recursively. This means that results for methods that call other methods include the counts of these called methods, i.e. of the entire calling tree. When false, only the counts for operation done in the method itself - not those by called methods - are returned.

    setAddUpResultsRecursively

    public void setAddUpResultsRecursively(boolean addUpResultsRecursively)
    Parameters:
    addUpResultsRecursively - When true, result retrieval adds up counting results recursively. This means that results for methods that call other methods include the counts of these called methods, i.e. of the entire calling tree. When false, only the counts for operation done in the method itself - not those by called methods - are returned.

    setParentClassLoader

    public void setParentClassLoader(java.lang.ClassLoader parentClassLoader)
    This is used for instantiation of classes that are set to execute. For some applications it may be necessary to use a different ClassLoader than the SystemClassLoader. For instance Eclipse plugins each have their own ClassLoader which means Class.forName() may not have access to the correct classpath.

    Parameters:
    parentClassLoader - The ClassLoader that will be used to create instances of the classes to execute.

    getParentClassLoader

    public java.lang.ClassLoader getParentClassLoader()
    Returns:
    The ClassLoader set using setParentClassLoader(ClassLoader).