public abstract class AbstractResourceWatcher<Listener> extends Object implements ResourceWatcher
| コンストラクタと説明 |
|---|
AbstractResourceWatcher() |
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
addListener(Listener listener)
Registers new listener
|
void |
checkAndNotify()
Called periodically by
ResourceWatcherService so resource watcher can check the resource |
protected abstract void |
doCheckAndNotify()
Will be called periodically
Implementing watcher should check resource and notify all
listeners(). |
protected abstract void |
doInit()
Will be called once on initialization
|
void |
init()
Called once when the resource watcher is added to
ResourceWatcherService |
protected List<Listener> |
listeners()
Returns a list of listeners
|
void |
remove(Listener listener)
Unregisters a listener
|
public void init()
throws IOException
ResourceWatcherResourceWatcherServiceinit インタフェース内 ResourceWatcherIOExceptionpublic void checkAndNotify()
throws IOException
ResourceWatcherResourceWatcherService so resource watcher can check the resourcecheckAndNotify インタフェース内 ResourceWatcherIOExceptionpublic void addListener(Listener listener)
public void remove(Listener listener)
protected abstract void doInit()
throws IOException
IOExceptionprotected abstract void doCheckAndNotify()
throws IOException
Implementing watcher should check resource and notify all listeners().
IOExceptionCopyright © 2009–2016. All rights reserved.