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
Modifier and TypeClassDescriptionstatic interface
An 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
-
Method Summary
Modifier and TypeMethodDescriptiongov.aps.jca.dbr.TimeStamp
Timestamp indicates last time value has been updated or confirmed.getValue()
getValue.static final OnDemandValueProcessor
newProcessor
(String name, gov.aps.jca.dbr.DBRType type, int count, String description) newProcessor.void
reset()
Resets cached value to null.void
The key which is associated with this processor and help provider distinguish between different processors.void
Sets new provider object.void
Sets 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
- aString
objecttype
- aDBRType
objectcount
- a intdescription
- aString
object- Returns:
- a
OnDemandValueProcessor
object
-
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
- aObject
object- 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
Object
object - 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
TimeStamp
object - 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.
-