Class TriggeredProbe
- java.lang.Object
-
- org.palladiosimulator.probeframework.probes.Probe
-
- org.palladiosimulator.probeframework.probes.TriggeredProbe
-
- All Implemented Interfaces:
org.palladiosimulator.commons.designpatterns.IAbstractObservable<IProbeListener>
,org.palladiosimulator.metricspec.metricentity.IMetricEntity
- Direct Known Subclasses:
BasicTriggeredProbe
,TriggeredProbeList
public abstract class TriggeredProbe extends Probe
Triggered probes measure as soon as theirtakeMeasurement
method is invoked (with optional context parameter of typeRequestContext
, e.g., the thread that triggered the probe. This invocation triggers the template methoddoMeasure
(with an optionally empty context). AfterdoMeasure
computed a new measurement,takeMeasurement
further informs all registered observers about the newly available measurement. The methoddoMeasure
itself has to be provided by classes inheriting from the this class.
-
-
Field Summary
-
Fields inherited from class org.palladiosimulator.probeframework.probes.Probe
metricEntityDelegate
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TriggeredProbe(org.palladiosimulator.metricspec.MetricDescription metricDescription)
Default constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ProbeMeasurement
doMeasure(RequestContext measurementContext)
Template method for taking the desired probe measurement in a given request context.ProbeMeasurement
takeMeasurement()
Takes a probe measurement.ProbeMeasurement
takeMeasurement(RequestContext measurementContext)
Takes a probe measurement for the given request context.-
Methods inherited from class org.palladiosimulator.probeframework.probes.Probe
addObserver, getMetricDesciption, isCompatibleWith, notifyMeasurementSourceListener, removeObserver
-
-
-
-
Method Detail
-
takeMeasurement
public ProbeMeasurement takeMeasurement()
Takes a probe measurement. Convenience method for an empty request context; refer to @see #takeMeasurement(RequestContext) for full documentation.- Returns:
- The taken probe measurement.
-
takeMeasurement
public ProbeMeasurement takeMeasurement(RequestContext measurementContext)
Takes a probe measurement for the given request context. This method is externally triggered, thus, being the main characteristic of this type of probe. Internally, the template methoddoMeasure
is used to obtain the concrete measurement. Afterwards, all registered observers are informed about this new measurement.- Parameters:
measurementContext
- The measurement context for this probe.- Returns:
- The taken probe measurement.
-
doMeasure
protected abstract ProbeMeasurement doMeasure(RequestContext measurementContext)
Template method for taking the desired probe measurement in a given request context.- Parameters:
measurementContext
- The measurement context for this probe.- Returns:
- The taken probe measurement.
-
-