public class ResourceAlterationMonitor
extends java.lang.Object
implements java.lang.Runnable
Created by rinoux on 2018/6/5.
构造器和说明 |
---|
ResourceAlterationMonitor(long interval,
ResourceAlterationObserver... observers)
创建监视器
|
限定符和类型 | 方法和说明 |
---|---|
java.lang.Iterable<ResourceAlterationObserver> |
getObservers() |
boolean |
initialized() |
boolean |
isRunning() |
void |
pause()
暂停monitor,不销毁,使用resume()恢复
|
void |
resume()
暂停之后的恢复,继续定时任务
|
void |
run() |
void |
start()
启动monitor,根据interval决定只执行一次还是定时执行
|
void |
stop()
终止并销毁monitor,暂停请使用pause()
|
public ResourceAlterationMonitor(long interval, ResourceAlterationObserver... observers)
interval
- 扫描间隔 -1为手动扫描observers
- 观察者public java.lang.Iterable<ResourceAlterationObserver> getObservers()
public void start() throws java.lang.Exception
java.lang.Exception
public void stop() throws java.lang.Exception
java.lang.Exception
public void pause()
public void resume()
public boolean initialized()
public boolean isRunning()
public void run()
run
在接口中 java.lang.Runnable