
public abstract class AbstractRecursiveFileSystemWatcher extends AbstractFileSystemWatcher
Thread.State, Thread.UncaughtExceptionHandler| Modifier and Type | Field and Description |
|---|---|
private Map<Path,AbstractRecursiveFileSystemWatcher> |
map |
private static String |
SLASH |
private ThreadManager |
tm |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY| Constructor and Description |
|---|
AbstractRecursiveFileSystemWatcher(String dir,
ThreadManager threadManager)
Builds a new RecursiveFileSystemWatcher.
|
| Modifier and Type | Method and Description |
|---|---|
abstract AbstractRecursiveFileSystemWatcher |
build(File file)
This method must be implemented by subclasses, and should basically provide a
constructor.
|
protected void |
created(Path file)
This method is invoked whenever a new file is created.
|
protected abstract void |
createdFile(Path p)
This method substitutes the created(Path).
|
protected void |
deleted(Path file)
This method is invoked whenever a file is deleted.
|
protected abstract void |
deletedFile(Path p)
This method substitutes the deleted(Path).
|
protected abstract void |
finalizeStop()
This method substitutes the stopService().
|
ThreadManager |
getThreadManager() |
void |
stopService()
If called, the service must stop.
|
getPath, modified, overflow, run, unknownisServiceAlive, setAliveactiveCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yieldprivate static final String SLASH
private final Map<Path,AbstractRecursiveFileSystemWatcher> map
private final ThreadManager tm
public AbstractRecursiveFileSystemWatcher(String dir, ThreadManager threadManager) throws IOException
dir - the directory to watchthreadManager - the ThreadManager where to schedule the sub-watchersIOException - in case of I/O Errorpublic abstract AbstractRecursiveFileSystemWatcher build(File file)
file - the file to watchprotected final void created(Path file)
AbstractFileSystemWatchercreated in class AbstractFileSystemWatcherfile - the file which has been createdprotected abstract void createdFile(Path p)
p - the new file createdprotected void deleted(Path file)
AbstractFileSystemWatcherdeleted in class AbstractFileSystemWatcherfile - the file which has been deletedprotected abstract void deletedFile(Path p)
p - the file which has been deletedprotected abstract void finalizeStop()
public ThreadManager getThreadManager()
public final void stopService()
AbstractServicestopService in class AbstractFileSystemWatcher