Class OnDemandValueProcessor
java.lang.Object
org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
org.scictrl.csshell.epics.server.processor.OnDemandValueProcessor
- All Implemented Interfaces:
ValueProcessor
OnDemandValueProcessor class.
- Author:
- igor@scictrl.com
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAn interface which is asked each time new value is needed. -
Field Summary
Fields inherited from class org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
log, record, trigger, type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongov.aps.jca.dbr.TimeStampTimestamp indicates last time value has been updated or confirmed.getValue()getValue.static final OnDemandValueProcessornewProcessor(String name, gov.aps.jca.dbr.DBRType type, int count, String description) newProcessor.voidreset()Resets cached value to null.voidThe key which is associated with this processor and help provider distinguish between different processors.voidSets new provider object.voidSets new value to the processor.Methods inherited from class org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
activate, configure, getName, getRecord, getTrigger, getType, process, toString
-
Constructor Details
-
OnDemandValueProcessor
public OnDemandValueProcessor()Constructor.
-
-
Method Details
-
newProcessor
public static final OnDemandValueProcessor newProcessor(String name, gov.aps.jca.dbr.DBRType type, int count, String description) newProcessor.
- Parameters:
name- aStringobjecttype- aDBRTypeobjectcount- a intdescription- aStringobject- Returns:
- a
OnDemandValueProcessorobject
-
setProvider
Sets new provider object. Provider is asked for new value when necessary.- Parameters:
provider- the on-demand value provided
-
setKey
The key which is associated with this processor and help provider distinguish between different processors.- Parameters:
key- the unique key
-
setValue
Sets new value to the processor. If value is different from current processor value, then event is fired. Timestamp is updated regardless if value is changed, since timestamp indicates last value update or confirmation. Does absolutly nothing, vbalue is oabtained trough provider.- Parameters:
value- aObjectobject- See Also:
-
getValue
getValue.
Each time EPICS server is asked for value this method is called. If this processor has value in cache, the value from cache is returned. If cached value is null (or it was never set or processor was reset), then the provider is asked for new value.- Returns:
- a
Objectobject - See Also:
-
getTimestamp
public gov.aps.jca.dbr.TimeStamp getTimestamp()Timestamp indicates last time value has been updated or confirmed. This does not necessary means value change. Timestamp of last time provider was asked for value.- Returns:
- a
TimeStampobject - See Also:
-
reset
public void reset()Resets cached value to null. So when next time getValue request will come, a new value will be requested from provider.
-