Class Poller

java.lang.Object
ucar.unidata.util.Poller
All Implemented Interfaces:
Runnable
Direct Known Subclasses:
FilePoller

public abstract class Poller extends Object implements Runnable
Class to handle polling.
Version:
$Revision: 1.17 $ $Date: 2006/05/05 19:19:36 $
Author:
Metapps development team
  • Field Details

    • debug

      public static boolean debug
      Debug flag
    • listener

      protected ActionListener listener
      listener for polling events
    • interval

      protected long interval
      interval for polling (milliseconds)
    • running

      protected boolean running
      flag for running
  • Constructor Details

    • Poller

      public Poller(long interval)
      Create a Poller
      Parameters:
      interval - polling interval
    • Poller

      public Poller(ActionListener listener, long interval)
      Create a Poller
      Parameters:
      listener - listener for events
      interval - polling interval
  • Method Details

    • init

      public void init()
      Initialize.
    • run

      public void run()
      Run the poller
      Specified by:
      run in interface Runnable
    • doPoll

      protected abstract void doPoll()
      This method does the work. Subclasses implement what they want.
    • stopRunning

      public void stopRunning()
      Stop polling.
    • getInterval

      public long getInterval()
      Get the polling interval
      Returns:
      the interval (milliseconds)