Constructor and Description |
---|
WatcherChain(Watcher... watchers)
构造
|
Modifier and Type | Method and Description |
---|---|
WatcherChain |
addChain(Watcher element)
加入责任链
|
static WatcherChain |
create(Watcher... watchers)
创建观察者链
WatcherChain |
Iterator<Watcher> |
iterator() |
void |
onCreate(WatchEvent<?> event,
Path currentPath)
文件创建时执行的方法
|
void |
onDelete(WatchEvent<?> event,
Path currentPath)
文件删除时执行的方法
|
void |
onModify(WatchEvent<?> event,
Path currentPath)
文件修改时执行的方法
文件修改可能触发多次 |
void |
onOverflow(WatchEvent<?> event,
Path currentPath)
事件丢失或出错时执行的方法
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public WatcherChain(Watcher... watchers)
watchers
- 观察者列表public static WatcherChain create(Watcher... watchers)
WatcherChain
watchers
- 观察者列表WatcherChain
public void onCreate(WatchEvent<?> event, Path currentPath)
Watcher
public void onModify(WatchEvent<?> event, Path currentPath)
Watcher
public void onDelete(WatchEvent<?> event, Path currentPath)
Watcher
public void onOverflow(WatchEvent<?> event, Path currentPath)
Watcher
onOverflow
in interface Watcher
event
- 事件currentPath
- 事件发生的当前Path路径public WatcherChain addChain(Watcher element)
Chain
addChain
in interface Chain<Watcher,WatcherChain>
element
- 责任链新的环节元素Copyright © 2021. All rights reserved.