Class ClassPathFileSystemWatcher
java.lang.Object
org.springframework.boot.devtools.classpath.ClassPathFileSystemWatcher
- All Implemented Interfaces:
Aware
,DisposableBean
,InitializingBean
,ApplicationContextAware
public class ClassPathFileSystemWatcher
extends Object
implements InitializingBean, DisposableBean, ApplicationContextAware
Encapsulates a
FileSystemWatcher
to watch the local classpath directories for
changes.- Since:
- 1.3.0
- Author:
- Phillip Webb
- See Also:
-
ClassPathFileChangeListener
-
Constructor Summary
ConstructorDescriptionClassPathFileSystemWatcher
(FileSystemWatcherFactory fileSystemWatcherFactory, ClassPathRestartStrategy restartStrategy, URL[] urls) Create a newClassPathFileSystemWatcher
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
destroy()
void
setApplicationContext
(ApplicationContext applicationContext) void
setStopWatcherOnRestart
(boolean stopWatcherOnRestart) Set if theFileSystemWatcher
should be stopped when a full restart occurs.
-
Constructor Details
-
ClassPathFileSystemWatcher
public ClassPathFileSystemWatcher(FileSystemWatcherFactory fileSystemWatcherFactory, ClassPathRestartStrategy restartStrategy, URL[] urls) Create a newClassPathFileSystemWatcher
instance.- Parameters:
fileSystemWatcherFactory
- a factory to create the underlyingFileSystemWatcher
used to monitor the local file systemrestartStrategy
- the classpath restart strategyurls
- the URLs to watch
-
-
Method Details
-
setStopWatcherOnRestart
public void setStopWatcherOnRestart(boolean stopWatcherOnRestart) Set if theFileSystemWatcher
should be stopped when a full restart occurs.- Parameters:
stopWatcherOnRestart
- if the watcher should be stopped when a restart occurs
-
setApplicationContext
- Specified by:
setApplicationContext
in interfaceApplicationContextAware
- Throws:
BeansException
-
afterPropertiesSet
- Specified by:
afterPropertiesSet
in interfaceInitializingBean
- Throws:
Exception
-
destroy
- Specified by:
destroy
in interfaceDisposableBean
- Throws:
Exception
-