Class AbstractPollingFunction

All Implemented Interfaces:
Function, ActionListener, EventListener
Direct Known Subclasses:
ClientFunctionFactory.IsAlarmActiveFilteredFunctionClient, ClientFunctionFactory.IsAlarmActiveFunctionClient, DefaultFunctionFactory.NowFunction, HasChangedFunction, ScriptFunction

public abstract class AbstractPollingFunction extends AbstractFunction implements ActionListener
  • Field Details

    • TIMER

      protected static final Timer TIMER
    • context

      protected CommonContext context
    • updateListener

      protected InteractionListener updateListener
    • task

      protected TimerTask task
    • rate

      protected int rate
    • started

      protected boolean started
  • Constructor Details

    • AbstractPollingFunction

      public AbstractPollingFunction()
  • Method Details

    • connect

      public void connect(CommonContext context, InteractionListener updateListener)
      Description copied from class: BaseFunction
      Empty implementation from BaseFunction. Override if necessary.
      Specified by:
      connect in interface Function
      Overrides:
      connect in class BaseFunction
    • disconnect

      public void disconnect()
      Description copied from class: BaseFunction
      Empty implementation from BaseFunction. Override if necessary.
      Specified by:
      disconnect in interface Function
      Overrides:
      disconnect in class BaseFunction
    • shutdown

      public void shutdown()
      Description copied from class: BaseFunction
      Empty implementation from BaseFunction. Override if necessary.
      Specified by:
      shutdown in interface Function
      Overrides:
      shutdown in class BaseFunction
    • startup

      public void startup()
      Description copied from class: BaseFunction
      Empty implementation from BaseFunction. Override if necessary.
      Specified by:
      startup in interface Function
      Overrides:
      startup in class BaseFunction
    • startTask

      protected void startTask()
    • cancelTask

      protected void cancelTask()
    • copy

      public abstract Function copy()
      Description copied from class: BaseFunction
      Returns this. Override to create a clone if you need a unique function object per Expression.
      Specified by:
      copy in interface Function
      Overrides:
      copy in class BaseFunction
    • setPollRate

      protected void setPollRate(int rate)
      Updates the poll rate. If the rate is <= 0, polling is disabled.
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      NOTE: This is in an "action listener" for legacy reasons, and doesn't need to be anymore. However, since we switched the timer in 7.7.6, we needed to maintain backwards compatibility with any sub classes that might override this function.
      Specified by:
      actionPerformed in interface ActionListener