org.mortbay.jetty.plugin.util
Class Scanner
java.lang.Object
java.lang.Thread
org.mortbay.jetty.plugin.util.Scanner
- All Implemented Interfaces:
- Runnable
public class Scanner
- extends Thread
Scanner
Scans a list of files and directories on a periodic basis to detect changes.
If a change in any of the watched files is found, then the target LifeCycle
objects are stopped and restarted.
This is used by the Jetty Maven plugin to watch the classes, dependencies
and web.xml file of a web application and to restart the webapp if any
of the above changes.
- Author:
- janb
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, 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, yield |
Scanner
public Scanner()
getRoots
public List getRoots()
- The files and directory roots to watch. Directories will be
recursively scanned.
- Returns:
- Returns the roots.
setRoots
public void setRoots(List roots)
- Parameters:
roots
- The roots to set.
getScanInterval
public int getScanInterval()
- Returns:
- Returns the scanInterval.
setScanInterval
public void setScanInterval(int scanInterval)
- Parameters:
scanInterval
- The scanInterval in seconds to set.
getListeners
public List getListeners()
- List of Scanner.Listener implementations.
- Returns:
- Returns the listeners.
setListeners
public void setListeners(List listeners)
- Parameters:
listeners
- The listeners to set.
run
public void run()
- Loop every scanInterval seconds until interrupted, checking to see if
any of the watched files have changed. If they have, stop and restart
the LifeCycle targets.
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread
- See Also:
Runnable.run()
Copyright © 2007 Mort Bay Consulting. All Rights Reserved.