Class AbstractScenarioThread
- java.lang.Object
-
- java.lang.Thread
-
- org.palladiosimulator.protocom.framework.java.se.usage.AbstractScenarioThread
-
- Direct Known Subclasses:
AbstractClosedScenarioThread
,AbstractOpenScenarioThread
public abstract class AbstractScenarioThread extends Thread implements IStopable
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
Fields Modifier and Type Field Description protected static org.apache.log4j.Logger
LOGGER
protected long
maxMeasurementCount
protected String
scenarioName
protected boolean
shouldContinue
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description 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.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Runnable
getScenarioRunner(RunProperties runProps)
Return a new instance of the usage scenario to be executed.void
requestStop()
void
run()
protected abstract void
runAndMeasureUsageScenarioIteration()
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 Detail
-
LOGGER
protected static final org.apache.log4j.Logger LOGGER
-
maxMeasurementCount
protected long maxMeasurementCount
-
shouldContinue
protected boolean shouldContinue
-
scenarioName
protected String scenarioName
-
-
Constructor Detail
-
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 Detail
-
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
protected abstract Runnable getScenarioRunner(RunProperties runProps)
Return a new instance of the usage scenario to be executed.- Parameters:
runProps
-- Returns:
-
-