@Singleton public class ScopedFileMonitorManager extends AbstractGlobalSingleton
FileMonitorManagerm_aRWLock| Constructor and Description |
|---|
ScopedFileMonitorManager()
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFileMonitor(FileMonitor aMonitor)
Add a new
FileMonitor. |
FileMonitor |
createFileMonitor(IFileMonitorCallback aListener)
Create a new
FileMonitor based on the passed file listener. |
int |
getChecksPerRun()
get the number of files to check per run.
|
long |
getDelay()
Get the delay between runs.
|
static ScopedFileMonitorManager |
getInstance() |
boolean |
isRunning() |
protected void |
onDestroy(IScope aScopeInDestruction)
Called when this singleton is destroyed.
|
EChange |
removeFileMonitor(FileMonitor aMonitor)
Remove a
FileMonitor. |
void |
setChecksPerRun(int nChecksPerRun)
set the number of files to check per run. a additional delay will be added
if there are more files to check
|
void |
setDelay(long nDelay)
Set the delay between runs.
|
EChange |
start()
Starts monitoring the files
|
EChange |
stop()
Stops monitoring the files.
|
getAllGlobalSingletons, getGlobalSingleton, getGlobalSingletonIfInstantiated, isGlobalSingletonInstantiatedgetAllSingletons, getSingleton, getSingletonIfInstantiated, getSingletonScopeKey, isDestroyed, isInDestruction, isInInstantiation, isInPreDestruction, isInstantiated, isSingletonInstantiated, isUsableObject, onAfterInstantiation, onBeforeDestroy, onBeforeScopeDestruction, onScopeDestruction, readAbstractSingletonFields, setDestroyed, setInDestruction, setInInstantiation, setInPreDestruction, setInstantiated, toString, writeAbstractSingletonFields@Deprecated @UsedViaReflection public ScopedFileMonitorManager()
@Nonnull public static ScopedFileMonitorManager getInstance()
protected void onDestroy(@Nonnull IScope aScopeInDestruction)
AbstractSingletonfalse
, "inDestruction" is true and "isDestroyed" is
false.onDestroy in class AbstractSingletonaScopeInDestruction - The scope in destruction. Never null.@Nonnull public EChange start()
EChangeIllegalStateException - if the monitoring is already runningisRunning(),
stop()public boolean isRunning()
true if the monitoring thread is running,
false if not.public long getDelay()
public void setDelay(long nDelay)
nDelay - The delay period in milliseconds.public int getChecksPerRun()
public void setChecksPerRun(int nChecksPerRun)
nChecksPerRun - a value less than 1 will disable this feature@Nonnull public FileMonitor createFileMonitor(@Nonnull IFileMonitorCallback aListener)
FileMonitor based on the passed file listener.aListener - The listener to be used. May not be null.FileMonitor that was already added.addFileMonitor(FileMonitor)public void addFileMonitor(@Nonnull FileMonitor aMonitor)
FileMonitor.aMonitor - The monitor to be added. May not be null.@Nonnull public EChange removeFileMonitor(@Nullable FileMonitor aMonitor)
FileMonitor.aMonitor - The monitor to be remove. May be null.EChangeCopyright © 2014–2015 Philip Helger. All rights reserved.