Package ucar.unidata.util
Class Poller
java.lang.Object
ucar.unidata.util.Poller
- All Implemented Interfaces:
Runnable
- Direct Known Subclasses:
FilePoller
Class to handle polling.
- Version:
- $Revision: 1.17 $ $Date: 2006/05/05 19:19:36 $
- Author:
- Metapps development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
Debug flagprotected long
interval for polling (milliseconds)protected ActionListener
listener for polling eventsprotected boolean
flag for running -
Constructor Summary
ConstructorsConstructorDescriptionPoller
(long interval) Create a PollerPoller
(ActionListener listener, long interval) Create a Poller -
Method Summary
-
Field Details
-
debug
public static boolean debugDebug flag -
listener
listener for polling events -
interval
protected long intervalinterval for polling (milliseconds) -
running
protected boolean runningflag for running
-
-
Constructor Details
-
Poller
public Poller(long interval) Create a Poller- Parameters:
interval
- polling interval
-
Poller
Create a Poller- Parameters:
listener
- listener for eventsinterval
- polling interval
-
-
Method Details
-
init
public void init()Initialize. -
run
public void run()Run the poller -
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)
-