Class AbstractScenarioThread
java.lang.Object
java.lang.Thread
org.palladiosimulator.protocom.framework.java.se.usage.AbstractScenarioThread
- Direct Known Subclasses:
AbstractClosedScenarioThread
,AbstractOpenScenarioThread
Abstract class for running both closed and open workload users.
For closed workloads, this class represents a single user. For open workloads, only one instance
of this class represents the usage scenario and spawns a new thread each time the interarrival
time has passed.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final org.apache.log4j.Logger
protected long
protected String
protected boolean
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionAbstractScenarioThread
(de.uka.ipd.sdq.sensorframework.entities.Experiment exp, de.uka.ipd.sdq.sensorframework.entities.ExperimentRun expRun, String scenarioName, RunProperties runProps) Initialise thread and perform warmup runs. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Runnable
getScenarioRunner
(RunProperties runProps) Return a new instance of the usage scenario to be executed.void
void
run()
protected abstract void
protected void
takeScenarioMeasurement
(long start) FIXME: duplicate, see ExperimentManager!Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Field Details
-
LOGGER
protected static final org.apache.log4j.Logger LOGGER -
maxMeasurementCount
protected long maxMeasurementCount -
shouldContinue
protected boolean shouldContinue -
scenarioName
-
-
Constructor Details
-
AbstractScenarioThread
public AbstractScenarioThread(de.uka.ipd.sdq.sensorframework.entities.Experiment exp, de.uka.ipd.sdq.sensorframework.entities.ExperimentRun expRun, String scenarioName, RunProperties runProps) Initialise thread and perform warmup runs. Number of warmup runs can be configured with -u option, or is 1000 as the default.- Parameters:
expRun
-timeSpanSensor
-runProps
-
-
-
Method Details
-
run
public void run() -
runAndMeasureUsageScenarioIteration
protected abstract void runAndMeasureUsageScenarioIteration() -
takeScenarioMeasurement
protected void takeScenarioMeasurement(long start) FIXME: duplicate, see ExperimentManager!- Parameters:
start
-
-
requestStop
public void requestStop()- Specified by:
requestStop
in interfaceIStopable
-
getScenarioRunner
Return a new instance of the usage scenario to be executed.- Parameters:
runProps
-- Returns:
-