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 Details

    • LOGGER

      protected static final org.apache.log4j.Logger LOGGER
  • Constructor Details

  • Method Details

    • getInstance

      public static ExperimentManager getInstance()
    • getName

      public String getName() throws RemoteException
      Specified by:
      getName in interface IExperimentManager
      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 time
      experimentRun -
      timeSpanSensor - sensor
    • createOrReuseTimeSpanSensor

      public static de.uka.ipd.sdq.sensorframework.entities.TimeSpanSensor createOrReuseTimeSpanSensor(String sensorName)
      Returns a TimeSpanSensor 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 new TimeSpanSensor 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

      public static void init(String experimentName, String directory, int remoteType)
      Creates a factory for file DAOs.
    • createExperimentRun

      public void createExperimentRun()
    • writeResultsAndClose

      public void writeResultsAndClose() throws RemoteException
      Description copied from interface: IExperimentManager
      Writes the experiment run to the specified DAO source.
      Specified by:
      writeResultsAndClose in interface IExperimentManager
      Throws:
      RemoteException
    • startNewExperimentRun

      public void startNewExperimentRun() throws RemoteException
      Description copied from interface: IExperimentManager
      Start a new experiment run.
      Specified by:
      startNewExperimentRun in interface IExperimentManager
      Throws:
      RemoteException