Package org.mockserver.persistence
Class FileWatcher
java.lang.Object
org.mockserver.persistence.FileWatcher
-
Constructor Summary
ConstructorsConstructorDescriptionFileWatcher(Path filePath, Runnable updatedHandler, Consumer<Throwable> errorHandler, MockServerLogger mockServerLogger, long pollPeriodMillis) -
Method Summary
Modifier and TypeMethodDescriptionstatic ScheduledExecutorServicebooleansetRunning(boolean running)
-
Constructor Details
-
FileWatcher
public FileWatcher(Path filePath, Runnable updatedHandler, Consumer<Throwable> errorHandler, MockServerLogger mockServerLogger, long pollPeriodMillis) - Parameters:
pollPeriodMillis- the interval, in milliseconds, between successive polls of the watched file. Captured here whenscheduleAtFixedRateis set up, so the first poll lands one full period after construction. The poll period is supplied per-watcher (via thewatchInitializationJsonPollPeriodMillisconfiguration property, seeConfiguration) rather than held in shared mutable static state, so concurrent watchers / tests can use different periods without racing each other. A non-positive value is clamped up to1msto satisfyscheduleAtFixedRate.
-
-
Method Details
-
getScheduler
-
isRunning
public boolean isRunning() -
setRunning
-