io.sarl.sre.janus.services.probing.probes
Class AbstractFieldProbe<T>
Type Parameters:
T - the type of the probed value.
All Superinterfaces:
Probe<T>
All Known Subclasses:
BigDecimalFieldProbe, BigIntegerFieldProbe, BooleanFieldProbe, ByteFieldProbe, CharacterFieldProbe, DoubleFieldProbe, FloatFieldProbe, IntegerFieldProbe, LongFieldProbe, ReferenceFieldProbe<T>, ShortFieldProbe
abstract class AbstractFieldProbe<T>
extends AbstractProbe<T>
Abstract probe implementation is linked to a field. A probe is thread-safe.
Parameters:
<T> - the type of the probed value.
Maven Group Identifier:
io.sarl.sre.janus
Maven Artifact Identifier:
janus.kernel
Since:
0.10
Property Summary
Modifier and type Property and description
protected FieldAccess field
protected java.util.concurrent.locks.ReadWriteLock inputLock
Replies the lock for input buffer.
protected java.util.concurrent.locks.ReadWriteLock outputLock
Replies the lock for output buffer.
T value
Inherited: name, type, uri
Constructor Summary
Action Summary
Modifier and type Action and description
protected abstract boolean areEqualValues(T,T)
Replies if the two given values are equal or not
protected FieldAccess getField
protected java.util.concurrent.locks.ReadWriteLock getInputLock
Replies the lock for input buffer.
protected java.util.concurrent.locks.ReadWriteLock getOutputLock
Replies the lock for output buffer.
T getValue
boolean isActive
protected boolean isActiveObject
Replies if the probed object is active.
boolean isInvalid
protected abstract java.lang.Object prepareFieldWriting(T,Class<T>,Object)
Convert the value.
protected T readFieldValue
Read the value from the field.
void release
void setValue(T)
void sync([boolean],[boolean])
protected T syncIn([boolean],Procedure3<P1,P2,P3>)
Do input synchronization.
protected void syncOut([boolean],Procedure3<P1,P2,P3>)
Do output synchronization.
protected abstract T toT(Object,Class<T>)
Convert the value.
protected T writeFieldValue(T)
Write the value from the field.
Property Details
field
protected val field : FieldAccess

This property is an alias for the action: getField

inputLock
protected val inputLock : java.util.concurrent.locks.ReadWriteLock
Replies the lock for input buffer.

This property is an alias for the action: getInputLock

Since:
0.12
outputLock
protected val outputLock : java.util.concurrent.locks.ReadWriteLock
Replies the lock for output buffer.

This property is an alias for the action: getOutputLock

Since:
0.12
value
var value : T

This property is an alias for the action: getValue

Constructor Details
new(IProbeReleaseListener,String,URI,Class<T>,FieldAccess,Provider<T>)
protected new(IProbeReleaseListener,String,URI,Class<T>,FieldAccess,Provider<T>)
Constructor.
Parameters:
manager - the creator of this probe, and its manager.
name - the name of the probe
uri - the UI of the field.
type - the expected type of the probed value.
field - the accessor to the probed field.
Action Details
areEqualValues(T,T)
protected def areEqualValues(T,T) : boolean
Replies if the two given values are equal or not
getField
protected def getField : FieldAccess
getInputLock
protected def getInputLock : java.util.concurrent.locks.ReadWriteLock
Replies the lock for input buffer.
Since:
0.12
getOutputLock
protected def getOutputLock : java.util.concurrent.locks.ReadWriteLock
Replies the lock for output buffer.
Since:
0.12
getValue
def getValue : T
isActive
def isActive : boolean
isActiveObject
protected def isActiveObject : boolean
Replies if the probed object is active.
isInvalid
def isInvalid : boolean
prepareFieldWriting(T,Class<T>,Object)
protected def prepareFieldWriting(T,Class<T>,Object) : java.lang.Object
Convert the value.
Parameters:
value - is the value.
concreteType - is the type of the field.
oldValue - the current/old value of the field.
Returns:
the value to write into the field.
readFieldValue
protected def readFieldValue : T
Read the value from the field. Do any outboxing or data convertion.
release
def release
setValue(T)
def setValue(T)
sync([boolean],[boolean])
def sync([boolean],[boolean])
syncIn([boolean],Procedure3<P1,P2,P3>)
protected def syncIn([boolean],Procedure3<P1,P2,P3>) : T
Do input synchronization.

This function is thread-safe.
Parameters:
forceSync - indicates if the synchronization with the input buffer is forced or not. Default value is false.
changeCallback - the callback invoked when the buffer has changed. Default value is null The arguments of the callback are the old value and the new value.
Returns:
the current buffer value.
syncOut([boolean],Procedure3<P1,P2,P3>)
protected def syncOut([boolean],Procedure3<P1,P2,P3>)
Do output synchronization.

This function is thread-safe.
Parameters:
forceSync - indicates if the synchronization with the input buffer is forced or not. Default value is false.
changeCallback - the callback invoked when the buffer has changed. Default value is null. The arguments of the callback are the old value and the new value.
toT(Object,Class<T>)
protected def toT(Object,Class<T>) : T
Convert the value.
Parameters:
value - is the value.
concreteType - is the type of the field.
writeFieldValue(T)
protected def writeFieldValue(T) : T
Write the value from the field. Do any outboxing or data convertion.
Parameters:
value - the new value.
Returns:
the old value.