Class FileMonitorConfiguration
java.lang.Object
org.springframework.cloud.config.monitor.FileMonitorConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware, org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.ResourceLoaderAware, org.springframework.context.SmartLifecycle
@Configuration(proxyBeanMethods=false)
@EnableScheduling
public class FileMonitorConfiguration
extends Object
implements org.springframework.context.SmartLifecycle, org.springframework.context.ResourceLoaderAware
Configuration for a file watcher that detects changes in local files related to the
environment repository. If any files change the
PropertyPathEndpoint is pinged
with the paths of the files. This applies to the source files of a local git repository
(i.e. a git repository with a "file:" URI) or to a native repository.- Author:
- Dave Syer, Gilles Robert
-
Field Summary
Fields inherited from interface org.springframework.context.SmartLifecycle
DEFAULT_PHASE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPhase()booleanbooleanvoidpoll()voidsetAutoStartup(boolean autoStartup) voidsetPhase(int phase) seegetPhase().voidsetResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) voidsetRunning(boolean running) voidstart()voidstop()voidMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.SmartLifecycle
isPauseable
-
Constructor Details
-
FileMonitorConfiguration
public FileMonitorConfiguration()
-
-
Method Details
-
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader) - Specified by:
setResourceLoaderin interfaceorg.springframework.context.ResourceLoaderAware
-
getPhase
public int getPhase()- Specified by:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.springframework.context.SmartLifecycle
-
setPhase
-
isRunning
public boolean isRunning()- Specified by:
isRunningin interfaceorg.springframework.context.Lifecycle
-
setRunning
public void setRunning(boolean running) - Parameters:
running- true if running.- See Also:
-
isAutoStartup
public boolean isAutoStartup()- Specified by:
isAutoStartupin interfaceorg.springframework.context.SmartLifecycle
-
setAutoStartup
public void setAutoStartup(boolean autoStartup) - Parameters:
autoStartup- true to auto start.- See Also:
-
start
public void start()- Specified by:
startin interfaceorg.springframework.context.Lifecycle
-
stop
public void stop()- Specified by:
stopin interfaceorg.springframework.context.Lifecycle
-
stop
- Specified by:
stopin interfaceorg.springframework.context.SmartLifecycle
-
poll
@Scheduled(fixedRateString="${spring.cloud.config.server.monitor.fixedDelay:5000}") public void poll()
-