Package gov.usgs.util
Interface Poller
- All Known Implementing Classes:
DirectoryPoller
public interface Poller
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddFileListener(FileListenerInterface listener) voidnotifyListeners(File file) Notify all listeners that files exist and need to be processed.voidremoveFileListener(FileListenerInterface listener) voidstart()Start polling in a background thread.voidstop()Stop any currently scheduled polling.
-
Method Details
-
addFileListener
- Parameters:
listener- FileListenerInterface to add
-
removeFileListener
- Parameters:
listener- FileListenerInterface to remove
-
start
void start()Start polling in a background thread. Any previously scheduled polling is stopped before starting at this frequency. This schedules using fixed-delay (time between complete polls) as opposed to fixed-rate (how often to start polling). -
stop
void stop()Stop any currently scheduled polling. -
notifyListeners
Notify all listeners that files exist and need to be processed.- Parameters:
file- that needs to be processed- Throws:
Exception
-