Class OnDemandValueProcessor

java.lang.Object
org.scictrl.csshell.epics.server.processor.AbstractValueProcessor
org.scictrl.csshell.epics.server.processor.OnDemandValueProcessor
All Implemented Interfaces:
ValueProcessor

public class OnDemandValueProcessor extends AbstractValueProcessor

OnDemandValueProcessor class.

Author:
igor@scictrl.com
  • 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 - a String object
      type - a DBRType object
      count - a int
      description - a String object
      Returns:
      a OnDemandValueProcessor object
    • setProvider

      public void setProvider(OnDemandValueProcessor.ValueProvider provider)
      Sets new provider object. Provider is asked for new value when necessary.
      Parameters:
      provider - the on-demand value provided
    • setKey

      public void setKey(Object key)
      The key which is associated with this processor and help provider distinguish between different processors.
      Parameters:
      key - the unique key
    • setValue

      public void setValue(Object value)
      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 - a Object object
      See Also:
    • getValue

      public Object 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.