WatchService logic in the FileReadingMessageSource.
Will be removed in Spring Integration 5.0.@Deprecated @UsesJava7 public class WatchServiceDirectoryScanner extends DefaultDirectoryScanner implements SmartLifecycle
WatchService.
The initial state of the directory is collected during start(). Subsequent
polls return new files as reported by ENTRY_CREATE events.
While initially walking the directory, any subdirectories encountered are registered to watch for creation events.
If subdirectories are subsequently added, they are walked and registered for new creation events, too.
When a StandardWatchEventKinds.OVERFLOW WatchKey event is occurred,
the directory is rescanned to avoid the loss for any new entries according
to the "missed events" logic around StandardWatchEventKinds.OVERFLOW.
| Constructor and Description |
|---|
WatchServiceDirectoryScanner(String directory)
Deprecated.
Construct an instance for the given directory.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPhase()
Deprecated.
|
boolean |
isAutoStartup()
Deprecated.
|
boolean |
isRunning()
Deprecated.
|
protected File[] |
listEligibleFiles(File directory)
Deprecated.
Subclasses may refine the listing strategy by overriding this method.
|
void |
setAutoStartup(boolean autoStartup)
Deprecated.
|
void |
setPhase(int phase)
Deprecated.
see
getPhase() |
void |
setRunning(boolean running)
Deprecated.
|
void |
start()
Deprecated.
|
void |
stop()
Deprecated.
|
void |
stop(Runnable callback)
Deprecated.
|
listFiles, setFilter, setLocker, tryClaimpublic WatchServiceDirectoryScanner(String directory)
directory - the directory.public void setPhase(int phase)
getPhase()phase - the phase.public void setRunning(boolean running)
running - true if running.isRunning()public boolean isAutoStartup()
isAutoStartup in interface SmartLifecyclepublic void setAutoStartup(boolean autoStartup)
autoStartup - true to auto start.isAutoStartup()public void stop(Runnable callback)
stop in interface SmartLifecycleprotected File[] listEligibleFiles(File directory)
DefaultDirectoryScannerlistEligibleFiles in class DefaultDirectoryScannerdirectory - root directory to use for listing