public final class BenchmarkExecutor extends Object
BeforeFirstRun
,
BeforeEachRun
, AfterEachRun
and AfterLastRun
classes. To store the data if the
single-execute before
classes have been executed, this class is implemented as a singleton to store
this information related to the method. All the data comes from the BenchmarkMethod
class.Modifier and Type | Method and Description |
---|---|
static PerfidixMethodCheckException |
checkMethod(Object obj,
Class<? extends Annotation> anno,
Method... meths)
Checking a method if it is reflective executable and if the mapping to
the object fits.
|
void |
executeAfterMethods(Object obj)
Executing the
AfterLastRun -annotated methods (if still wasn't)
and the AfterEachRun methods. |
void |
executeBeforeMethods(Object obj)
Executing the
BeforeFirstRun -annotated methods (if still wasn't)
and the BeforeEachRun methods. |
void |
executeBench(Object objToExecute)
Execution of bench method.
|
static BenchmarkExecutor |
getExecutor(BenchmarkElement meth)
Getting the executor corresponding to a BenchmarkElement.
|
static void |
initialize(AbstractConfig config,
BenchmarkResult result)
Initializing the executor.
|
static PerfidixMethodInvocationException |
invokeMethod(Object obj,
Class<? extends Annotation> relatedAnno,
Method... meths)
Method to invoke a reflective invokable method.
|
public static BenchmarkExecutor getExecutor(BenchmarkElement meth)
meth
- for the executor. If the underlaying Method
was not
registered, a new mapping-entry will be created.public static void initialize(AbstractConfig config, BenchmarkResult result)
config
- to be benchedresult
- to be stored topublic void executeBeforeMethods(Object obj)
BeforeFirstRun
-annotated methods (if still wasn't)
and the BeforeEachRun
methods.obj
- the object of the class where the bench runs currently in.public void executeBench(Object objToExecute)
objToExecute
- the instance of the benchclass where the method should be
executed with.public void executeAfterMethods(Object obj)
AfterLastRun
-annotated methods (if still wasn't)
and the AfterEachRun
methods.obj
- the object of the class where the bench runs currently in.public static PerfidixMethodInvocationException invokeMethod(Object obj, Class<? extends Annotation> relatedAnno, Method... meths)
obj
- on which the execution takes placemeth
- to be executedrelatedAnno
- related annotation for the executionPerfidixMethodInvocationException
if invocation fails,
null otherwise.public static PerfidixMethodCheckException checkMethod(Object obj, Class<? extends Annotation> anno, Method... meths)
obj
- on which the execution takes placemeths
- to be checkedanno
- the related annotation for the checkPerfidixMethodCheckException
if something is wrong in the
mapping, null otherwise.Copyright © 2013 University of Konstanz, Distributed Systems Group. All Rights Reserved.