public abstract class AbstractResourceWatcher<Listener> extends Object implements ResourceWatcher
| Constructor and Description |
|---|
AbstractResourceWatcher() |
| Modifier and Type | Method and Description |
|---|---|
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()
ResourceWatcherResourceWatcherServiceinit in interface ResourceWatcherpublic void checkAndNotify()
ResourceWatcherResourceWatcherService so resource watcher can check the resourcecheckAndNotify in interface ResourceWatcherpublic void addListener(Listener listener)
public void remove(Listener listener)
protected abstract void doInit()
protected abstract void doCheckAndNotify()
listeners().Copyright © 2009–2016. All rights reserved.