public class FileMonitor extends Object implements Executable
| 限定符和类型 | 字段和说明 |
|---|---|
private Executor |
executor |
private long |
interval |
private AtomicBoolean |
running |
private TimeUnit |
timeUnit |
private List<FileWatcher> |
watchers |
| 构造器和说明 |
|---|
FileMonitor(long interval,
TimeUnit timeUnit) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addWatchers(FileWatcher... fileWatchers) |
protected void |
afterRunning() |
protected void |
beforeRunning() |
boolean |
execute() |
boolean |
isRunning() |
void |
onCancellation() |
void |
removeWatchers(FileWatcher... fileWatchers) |
void |
setExecutor(Executor executor) |
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonCancellation, onErrorprivate final List<FileWatcher> watchers
private final long interval
private final TimeUnit timeUnit
private final AtomicBoolean running
private Executor executor
public FileMonitor(long interval,
TimeUnit timeUnit)
public void addWatchers(FileWatcher... fileWatchers)
public void removeWatchers(FileWatcher... fileWatchers)
public void start()
public void stop()
public void setExecutor(Executor executor)
public boolean isRunning()
public boolean execute()
execute 在接口中 Executablepublic void onCancellation()
protected void beforeRunning()
protected void afterRunning()
Copyright © 2020. All rights reserved.