public abstract class AbstractNIO2Watcher extends Object implements Watcher
| Modifier and Type | Field and Description |
|---|---|
protected Map<WatchEventListener,ClassLoader> |
classLoaderListeners |
protected EventDispatcher |
dispatcher |
protected Map<WatchKey,PathPair> |
keys |
protected static WatchEvent.Kind<?>[] |
KINDS |
protected AgentLogger |
LOGGER |
protected WatchService |
watcher |
| Constructor and Description |
|---|
AbstractNIO2Watcher() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDirectory(Path path)
Registers the given directory
|
void |
addEventListener(ClassLoader classLoader,
URI pathPrefix,
WatchEventListener listener)
Register listeners on an event.
|
void |
addEventListener(ClassLoader classLoader,
URL pathPrefix,
WatchEventListener listener)
Register listeners on an event.
|
void |
closeClassLoader(ClassLoader classLoader)
Remove all transformers registered with a classloader
|
protected abstract void |
registerAll(Path watched,
Path target) |
void |
run()
Run the watcher agent thread.
|
void |
stop()
Stop the watcher agent thread.
|
protected AgentLogger LOGGER
protected static final WatchEvent.Kind<?>[] KINDS
protected WatchService watcher
protected Map<WatchEventListener,ClassLoader> classLoaderListeners
protected final EventDispatcher dispatcher
public AbstractNIO2Watcher()
throws IOException
IOExceptionpublic void addEventListener(ClassLoader classLoader, URI pathPrefix, WatchEventListener listener)
WatcheraddEventListener in interface WatcherclassLoader - the classloader to which this path is associated. May be null, but then this
listener will never be disassociated (even if application is undeployed)pathPrefix - where to listenlistener - the listenerpublic void addEventListener(ClassLoader classLoader, URL pathPrefix, WatchEventListener listener)
WatcheraddEventListener in interface WatcherclassLoader - the classloader to which this path is associated. May be null, but then this
listener will never be disassociated (even if application is undeployed)pathPrefix - where to listenlistener - the listenerpublic void closeClassLoader(ClassLoader classLoader)
closeClassLoader in interface WatcherclassLoader - public void addDirectory(Path path) throws IOException
IOExceptionprotected abstract void registerAll(Path watched, Path target) throws IOException
IOExceptionpublic void run()
WatcherCopyright © 2018. All rights reserved.