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
Triggered probes measure as soon as their
takeMeasurement
method is invoked (with
optional context parameter of type RequestContext
, e.g., the thread that triggered
the probe. This invocation triggers the template method doMeasure
(with an
optionally empty context). After doMeasure
computed a new measurement,
takeMeasurement
further informs all registered observers about the newly available
measurement.
The method doMeasure
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
ModifierConstructorDescriptionprotected
TriggeredProbe
(org.palladiosimulator.metricspec.MetricDescription metricDescription) Default constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ProbeMeasurement
doMeasure
(RequestContext measurementContext) Template method for taking the desired probe measurement in a given request context.Takes a probe measurement.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
-
Constructor Details
-
TriggeredProbe
protected TriggeredProbe(org.palladiosimulator.metricspec.MetricDescription metricDescription) Default constructor.- Parameters:
metricDescription
- The metric of the measurements delivered by this probe.
-
-
Method Details
-
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
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
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.
-