Class ExperimentManager
java.lang.Object
java.rmi.server.RemoteObject
java.rmi.server.RemoteServer
java.rmi.server.UnicastRemoteObject
org.palladiosimulator.protocom.framework.java.se.experiment.ExperimentManager
- All Implemented Interfaces:
Serializable
,Remote
,IExperimentManager
public class ExperimentManager
extends UnicastRemoteObject
implements IExperimentManager, Serializable
Manages the time span sensors and measurements.
- See Also:
-
Field Summary
Fields inherited from class java.rmi.server.RemoteObject
ref
Fields inherited from interface org.palladiosimulator.protocom.framework.java.se.experiment.IExperimentManager
EXPERIMENT_MANAGER_MASTER, EXPERIMENT_MANAGER_SLAVE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic de.uka.ipd.sdq.sensorframework.entities.ExperimentRun
Adds a new experiment run to the experiment.void
static de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor
createOrReuseTimeSpanSensor
(String sensorName) Returns aTimeSpanSensor
in the experiment that has the name sensorName.static de.uka.ipd.sdq.sensorframework.entities.Experiment
static ExperimentManager
static de.uka.ipd.sdq.sensorframework.entities.ExperimentRun
Returns the newest experiment run instance.getName()
static void
Creates a factory for file DAOs.void
Start a new experiment run.static void
takeMeasurement
(long start, de.uka.ipd.sdq.sensorframework.entities.ExperimentRun experimentRun, de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor timeSpanSensor) Takes a measurement (from start time till current time) on the given sensorstatic long
Restored this from an older version.void
Writes the experiment run to the specified DAO source.Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
Methods inherited from class java.rmi.server.RemoteServer
getClientHost, getLog, setLog
-
Field Details
-
LOGGER
protected static final org.apache.log4j.Logger LOGGER
-
-
Constructor Details
-
ExperimentManager
- Throws:
RemoteException
-
-
Method Details
-
getInstance
-
getName
- Specified by:
getName
in interfaceIExperimentManager
- Throws:
RemoteException
-
getExperiment
public static de.uka.ipd.sdq.sensorframework.entities.Experiment getExperiment() -
addExperimentRun
public static de.uka.ipd.sdq.sensorframework.entities.ExperimentRun addExperimentRun()Adds a new experiment run to the experiment. Current date is used for as date.- Returns:
- the newly created experiment run
-
takeStartTimeForInnerMeasurement
public static long takeStartTimeForInnerMeasurement()Restored this from an older version. Will be changed eventually.- Returns:
-
takeMeasurement
public static void takeMeasurement(long start, de.uka.ipd.sdq.sensorframework.entities.ExperimentRun experimentRun, de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor timeSpanSensor) Takes a measurement (from start time till current time) on the given sensor- Parameters:
start
- start timeexperimentRun
-timeSpanSensor
- sensor
-
createOrReuseTimeSpanSensor
public static de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor createOrReuseTimeSpanSensor(String sensorName) Returns aTimeSpanSensor
in the experiment that has the name sensorName. Creates a new sensor and returns it of no sensor with this name exists. The reuse is required because the EJB container may decide at times to create new instances of the components, so for one component type and one signature, this method may be called multiple times during the measurements. We want to store all results per component type into one sensor, though.- Parameters:
sensorName
- The sensor name to match- Returns:
- The
TimeSpanSensor
with the passed name or a newTimeSpanSensor
with that name that is then also added to the experiment.
-
getLatestExperimentRun
public static de.uka.ipd.sdq.sensorframework.entities.ExperimentRun getLatestExperimentRun()Returns the newest experiment run instance. If no one exists, a new experiment run will be created. Note that the experiment run usually should be created explicitly and not here. This one is just a (quick) fix to get measurements from sensors running on instances different from the usage scenario.- Returns:
- latest experiment run instance or a new one
-
init
Creates a factory for file DAOs. -
createExperimentRun
public void createExperimentRun() -
writeResultsAndClose
Description copied from interface:IExperimentManager
Writes the experiment run to the specified DAO source.- Specified by:
writeResultsAndClose
in interfaceIExperimentManager
- Throws:
RemoteException
-
startNewExperimentRun
Description copied from interface:IExperimentManager
Start a new experiment run.- Specified by:
startNewExperimentRun
in interfaceIExperimentManager
- Throws:
RemoteException
-