Class AbstractRecordingProbeFrameworkListenerDecorator
- java.lang.Object
-
- org.palladiosimulator.simulizar.interpreter.listener.AbstractRecordingProbeFrameworkListenerDecorator
-
- Direct Known Subclasses:
AggregatorsProbeFrameworkListenerDecorator
,FeedThroughDecorator
,MonitorRepositoryMapProbeFrameworkListenerDecorator
,SlidingWindowProbeFrameWorkListenerDecorator
,UtilizationProbeFrameworkListenerDecorator
public abstract class AbstractRecordingProbeFrameworkListenerDecorator extends Object
This class has to be implemented by all clients that wish to have additional measurements recorded, i.e., by all classes that make use of theorg.palladiosimulator.simulizar.interpreter.listener.probeframework
extension point.
-
-
Constructor Summary
Constructors Constructor Description AbstractRecordingProbeFrameworkListenerDecorator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Map<String,Object>
createRecorderConfigMapWithAcceptedMetricAndMeasuringPoint(org.palladiosimulator.metricspec.MetricDescription recorderAcceptedMetric, org.palladiosimulator.edp2.models.measuringpoint.MeasuringPoint measuringPoint)
Convenience method to create a recorder configuration map which has theAbstractRecorderConfiguration.RECORDER_ACCEPTED_METRIC
attribute (key) set to the given metric description and theAbstractRecorderConfiguration.MEASURING_POINT
attribute (key) set to the given measuring point.protected org.palladiosimulator.recorderframework.config.IRecorderConfiguration
createRecorderConfiguration(de.uka.ipd.sdq.simucomframework.SimuComConfig config, Map<String,Object> recorderConfigMap)
Method to obtain anIRecorderConfiguration
used for the recording of the measurements.protected org.palladiosimulator.probeframework.ProbeFrameworkContext
getProbeFrameworkContext()
Gets the currentProbeFrameworkContext
.protected AbstractProbeFrameworkListener
getProbeFrameworkListener()
Gets the currentProbeFrameworkListener
instance.protected org.palladiosimulator.recorderframework.IRecorder
initializeRecorder(Map<String,Object> recorderConfigMap)
Template method to instantiate and initialize aIRecorder
implementation based on theSimuComConfig
of the current SimuLizar run.protected org.palladiosimulator.recorderframework.IRecorder
instantiateRecorder(de.uka.ipd.sdq.simucomframework.SimuComConfig config)
Method to instantiate anIRecorder
used for the recording of the measurements.void
registerMeasurements()
Registers additional measurements to be observed/stored by the probe framework listener.
This method is called by theProbeFrameworkListener
in order to have additional measurements attached.protected void
registerMeasurementsRecorder(org.palladiosimulator.measurementframework.listener.MeasurementSource measurementSource, org.palladiosimulator.recorderframework.IRecorder recorder)
Registers the given recorder at the given measurement source, i.e., adds it to the list of observers.void
setProbeFrameworkListener(AbstractProbeFrameworkListener probeFrameworkListener)
Injects the probe framework listener that is decorated by this class.
-
-
-
Method Detail
-
setProbeFrameworkListener
public void setProbeFrameworkListener(AbstractProbeFrameworkListener probeFrameworkListener)
Injects the probe framework listener that is decorated by this class.- Parameters:
probeFrameworkListener
- TheProbeFrameworkListener
used during the current simulation run.
-
registerMeasurements
public void registerMeasurements()
Registers additional measurements to be observed/stored by the probe framework listener.
This method is called by theProbeFrameworkListener
in order to have additional measurements attached.
-
getProbeFrameworkListener
protected AbstractProbeFrameworkListener getProbeFrameworkListener()
Gets the currentProbeFrameworkListener
instance.- Returns:
- The current
AbstractProbeFrameworkListener
that has been passed to this instance viasetProbeFrameworkListener(AbstractProbeFrameworkListener)
.
-
getProbeFrameworkContext
protected org.palladiosimulator.probeframework.ProbeFrameworkContext getProbeFrameworkContext()
Gets the currentProbeFrameworkContext
.- Returns:
- the
ProbeFrameworkContext
of the running simulation.
-
initializeRecorder
protected org.palladiosimulator.recorderframework.IRecorder initializeRecorder(Map<String,Object> recorderConfigMap)
Template method to instantiate and initialize aIRecorder
implementation based on theSimuComConfig
of the current SimuLizar run.- Parameters:
recorderConfigMap
- AMap
which contains the recorder configuration attributes.- Returns:
- An
IRecorder
initialized with the given configuration. - See Also:
instantiateRecorder(SimuComConfig)
,createRecorderConfigMapWithAcceptedMetricAndMeasuringPoint(MetricDescription, MeasuringPoint)
-
instantiateRecorder
protected org.palladiosimulator.recorderframework.IRecorder instantiateRecorder(de.uka.ipd.sdq.simucomframework.SimuComConfig config)
Method to instantiate anIRecorder
used for the recording of the measurements. This method is called withininitializeRecorder(Map)
to the initialization of the created recorder.- Parameters:
config
- TheSimuComConfig
which contains the configuration of the current simulation run.- Returns:
- This default implementation returns the result of
RecorderExtensionHelper.instantiateRecorderImplementationForRecorder(config.getRecorderName());
.
-
createRecorderConfiguration
protected org.palladiosimulator.recorderframework.config.IRecorderConfiguration createRecorderConfiguration(de.uka.ipd.sdq.simucomframework.SimuComConfig config, Map<String,Object> recorderConfigMap)
Method to obtain anIRecorderConfiguration
used for the recording of the measurements. This method is called withininitializeRecorder(Map)
to initialize the created recorder after it has been instantiated.- Parameters:
config
- TheSimuComConfig
which contains the configuration of the current simulation run.recorderConfigMap
- AMap
with the configuration attributes.- Returns:
- This default implementation returns the result of
config.getRecorderConfigurationFactory().createRecorderConfiguration(recorderConfigMap);
.
-
registerMeasurementsRecorder
protected void registerMeasurementsRecorder(org.palladiosimulator.measurementframework.listener.MeasurementSource measurementSource, org.palladiosimulator.recorderframework.IRecorder recorder)
Registers the given recorder at the given measurement source, i.e., adds it to the list of observers.- Parameters:
measurementSource
- TheMeasurementSource
whose measurements shall be recorded.recorder
- TheIRecorder
to record new measurements produced by the given source.
-
createRecorderConfigMapWithAcceptedMetricAndMeasuringPoint
public static Map<String,Object> createRecorderConfigMapWithAcceptedMetricAndMeasuringPoint(org.palladiosimulator.metricspec.MetricDescription recorderAcceptedMetric, org.palladiosimulator.edp2.models.measuringpoint.MeasuringPoint measuringPoint)
Convenience method to create a recorder configuration map which has theAbstractRecorderConfiguration.RECORDER_ACCEPTED_METRIC
attribute (key) set to the given metric description and theAbstractRecorderConfiguration.MEASURING_POINT
attribute (key) set to the given measuring point.- Parameters:
recorderAcceptedMetric
- TheMetricDescription
to be put in the map.measuringPoint
- TheMeasuringPoint
to be put in the map.- Returns:
- A recorder configuration
Map
initialized as described. - See Also:
initializeRecorder(Map)
-
-