public abstract class AbstractProbeService extends AbstractSreService implements ProbeService, IProbeReleaseListener
Modifier | Constructor and Description |
---|---|
protected |
AbstractProbeService(internalStructure : Map<URI,Probe<?>>,
namespaceService : NamespaceService,
nameParser : NameParser,
listenerCollectionProvider : javax.inject.Provider<SmartListenerCollection<?>>)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Collection<Probe<?>> |
getProbes()
Replies all the probes.
|
protected <T> Probe<T> |
newProbe(probedElement : Object,
valueType : Class<T>,
probeUri : URI,
probeName : String)
Create an instance of the probe.
|
protected void |
onFirstProbe()
Invoked when the first probe is added into the service.
|
protected void |
onLastProbe()
Invoked when the last probe is removed from the service.
|
void |
onProbeReleasedProbe(probe : Probe<?>)
Invoked when a probe was released.
|
protected void |
onStop()
Do something when stopping the service.
|
<T> Probe<T> |
probe(valueName : SarlName,
valueType : Class<T>,
[probeName : String])
Create a probe.
|
<T> Probe<T> |
probe(valueName : String,
valueType : Class<T>,
[probeName : String])
Create a probe.
|
<T> Probe<T> |
probe(valueName : URI,
valueType : Class<T>,
[probeName : String])
Create a probe.
|
void |
releaseAllProbes()
Release all the probes.
|
void |
sync()
Force the synchronization of the probes.
|
doStart, doStop, onStart
addListener, awaitRunning, awaitRunning, awaitTerminated, awaitTerminated, doCancelStart, failureCause, isRunning, notifyFailed, notifyStarted, notifyStopped, startAsync, state, stopAsync, toString
protected new
(internalStructure : Map<URI,Probe<?>>,
namespaceService : NamespaceService,
nameParser : NameParser,
listenerCollectionProvider : javax.inject.Provider<SmartListenerCollection<?>>)
internalStructure
- is the internal structure for storing the probes.namespaceService
- the service that is giving access to the namespaces.nameParser
- the object that is able to parse resource names.listenerCollectionProvider
- the provider of listener collections.lockProvider
- the provider of synchronization locks.protected def
onStop() : void
AbstractSreService
This function is called from AbstractSreService.doStop()
onStop
in class AbstractSreService
publicdef
probe(valueName : String, valueType : Class<T>, [probeName : String]) : Probe<T>with
<T>
ProbeService
If a probe with the same name name exists, a composed probe with the probe name is created with the probes as composite.
probe
in interface ProbeService
valueName
- the probed element.valueType
- the expected type of the value.probeName
- is the optional name of the probe.publicdef
probe(valueName : URI, valueType : Class<T>, [probeName : String]) : Probe<T>with
<T>
ProbeService
If a probe with the same name name exists, a composed probe with the probe name is created with the probes as composite.
probe
in interface ProbeService
valueName
- the probed element.valueType
- the expected type of the value.probeName
- is the optional name of the probe.publicdef
probe(valueName : SarlName, valueType : Class<T>, [probeName : String]) : Probe<T>with
<T>
ProbeService
If a probe with the same name name exists, a composed probe with the probe name is created with the probes as composite.
probe
in interface ProbeService
valueName
- the probed element.valueType
- the expected type of the value.probeName
- is the optional name of the probe.protected def
onFirstProbe() : void
AbstractProbeService
protected def
onLastProbe() : void
AbstractProbeService
@Pure protecteddef
newProbe(probedElement : Object, valueType : Class<T>, probeUri : URI, probeName : String) : Probe<T>with
<T>
AbstractProbeService
T
- the expected type of the probed values.probedElement
- the element to which the probe must be associated, never null
.valueType
- the expected type of the probed values, never null
.probeUri
- the URI of the probe, never null
.probeName
- the name of the probe, never null
.@Pure
public def
getProbes() : Collection<Probe<?>>
ProbeService
getProbes
in interface ProbeService
public def
releaseAllProbes() : void
ProbeService
releaseAllProbes
in interface ProbeService
public def
sync() : void
ProbeService
sync
in interface ProbeService
public def
onProbeReleasedProbe(probe : Probe<?>) : void
IProbeReleaseListener
onProbeReleasedProbe
in interface IProbeReleaseListener
probe
- is the released probe.Copyright © 2020 the original authors or authors.