Class WatchManager
- java.lang.Object
-
- org.apache.logging.log4j.core.AbstractLifeCycle
-
- org.apache.logging.log4j.core.util.WatchManager
-
- All Implemented Interfaces:
LifeCycle
,LifeCycle2
public class WatchManager extends AbstractLifeCycle
Manages FileWatchers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.logging.log4j.core.LifeCycle
LifeCycle.State
-
-
Field Summary
-
Fields inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
DEFAULT_STOP_TIMEOUT, DEFAULT_STOP_TIMEUNIT, LOGGER
-
-
Constructor Summary
Constructors Constructor Description WatchManager(ConfigurationScheduler scheduler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIntervalSeconds()
java.util.Map<java.io.File,FileWatcher>
getWatchers()
void
setIntervalSeconds(int intervalSeconds)
void
start()
boolean
stop(long timeout, java.util.concurrent.TimeUnit timeUnit)
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.java.lang.String
toString()
void
watchFile(java.io.File file, FileWatcher watcher)
-
Methods inherited from class org.apache.logging.log4j.core.AbstractLifeCycle
equalsImpl, getState, getStatusLogger, hashCodeImpl, initialize, isInitialized, isStarted, isStarting, isStopped, isStopping, setStarted, setStarting, setState, setStopped, setStopping, stop, stop
-
-
-
-
Constructor Detail
-
WatchManager
public WatchManager(ConfigurationScheduler scheduler)
-
-
Method Detail
-
setIntervalSeconds
public void setIntervalSeconds(int intervalSeconds)
-
getIntervalSeconds
public int getIntervalSeconds()
-
start
public void start()
- Specified by:
start
in interfaceLifeCycle
- Overrides:
start
in classAbstractLifeCycle
-
stop
public boolean stop(long timeout, java.util.concurrent.TimeUnit timeUnit)
Description copied from interface:LifeCycle2
Blocks until all tasks have completed execution after a shutdown request, or the timeout occurs, or the current thread is interrupted, whichever happens first.- Specified by:
stop
in interfaceLifeCycle2
- Overrides:
stop
in classAbstractLifeCycle
- Parameters:
timeout
- the maximum time to waittimeUnit
- the time unit of the timeout argument- Returns:
- true if the receiver was stopped cleanly and normally, false otherwise.
-
watchFile
public void watchFile(java.io.File file, FileWatcher watcher)
-
getWatchers
public java.util.Map<java.io.File,FileWatcher> getWatchers()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-