public abstract class Notifier<KEY> extends Object
Constructor and Description |
---|
Notifier() |
Modifier and Type | Method and Description |
---|---|
protected abstract KEY |
addWatch(String path)
Register a path for notifications.
|
protected abstract String |
nextEvent() |
protected abstract void |
removeWatch(KEY key)
Unregister a path.
|
protected abstract void |
start()
Starts the notifier.
|
protected void |
stop()
Get ready for stop.
|
protected abstract KEY addWatch(String path) throws IOException
Notifier.removeWatch(java.lang.Object)
properly.path
- the path to register for notificationsIOException
- if the path can't be registered. For example if the
OS limit on the number of watched folders is reached. The exception
should be annotated with localized explanation.protected abstract void removeWatch(KEY key) throws IOException
null
from the Notifier.addWatch(java.lang.String)
call.key
- the key obtained during registration.IOException
protected abstract String nextEvent() throws IOException, InterruptedException
IOException
InterruptedException
protected abstract void start() throws IOException
IOException
- if the initialization cannot be performedprotected void stop() throws IOException
IOException