Class StateWatchdogProcessor

All Implemented Interfaces:
PropertyChangeListener, EventListener, ValueProcessor

public class StateWatchdogProcessor extends DefaultAlarmProcessor

StateWatchdogProcessor class.

Author:
igor@scictrl.com
  • Constructor Details

    • StateWatchdogProcessor

      public StateWatchdogProcessor()

      Constructor for StateWatchdogProcessor.

  • Method Details

    • configure

      public void configure(Record record, org.apache.commons.configuration.HierarchicalConfiguration config)
      Configures the internals of value processor, provides reference to parent record and to configuration with root inside processor tag. Parent record is not yet initialized, so does not have reference to Database, the Database reference will be available during activate call.
      Specified by:
      configure in interface ValueProcessor
      Overrides:
      configure in class DefaultAlarmProcessor
      Parameters:
      record - the parent record.
      config - configuration with room inside processor tag.
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
      Overrides:
      propertyChange in class DefaultAlarmProcessor
    • _setValue

      protected boolean _setValue(Object value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify, boolean force)
      Internal set: sets new value to this processor. It checks if it is fixed, it never sets fixed value. Fires value update event only if value was changes and notify is true. If force is true, then updates value and fires notify, if notify is true, even if value was not changed. If the value is not an array it tries to convert it to a single element array. Updates timestamp. If required fires notify event.
      Overrides:
      _setValue in class MemoryValueProcessor
      Parameters:
      value - value to be set
      severity - the severity to be used together with the value update. If null no alarm update is fired.
      status - the status to be used together with the value update. If null no alarm update is fired.
      notify - if true fire notify event if value was change, false suppresses events
      force - if true it will update value and timestamp even if there is not new value and proceeds with notify
      Returns:
      true if value was updated, regardless if based on difference or force
    • _setValue

      protected boolean _setValue(boolean value, gov.aps.jca.dbr.Severity severity, gov.aps.jca.dbr.Status status, boolean notify, boolean force)
      Internal set: sets new value to this processor. It checks if it is fixed, it never sets fixed value. Fires value update event only if value was changes and notify is true. If force is true, then updates value and fires notify, if notify is true, even if value was not changed. If the value is not an array it tries to convert it to a single element array. Updates timestamp. If required fires notify event.
      Overrides:
      _setValue in class MemoryValueProcessor
      Parameters:
      value - value to be set
      severity - the severity to be used together with the value update. If null no alarm update is fired.
      status - the status to be used together with the value update. If null no alarm update is fired.
      notify - if true fire notify event if value was change, false suppresses events
      force - if true it will update value and timestamp even if there is not new value and proceeds with notify
      Returns:
      true if value was updated, regardless if based on difference or force
    • update

      protected boolean update(boolean notify)

      update.

      Parameters:
      notify - a boolean
      Returns:
      a boolean
    • process

      public void process()
      Called by Database in interval set by the trigger parameter in milliseconds. Not called if trigger in 0.
      Specified by:
      process in interface ValueProcessor
      Overrides:
      process in class AbstractValueProcessor