- java.lang.Object
-
- ch.qos.logback.core.spi.ContextAwareBase
-
- ch.qos.logback.core.joran.spi.ConfigurationWatchList
-
- All Implemented Interfaces:
ContextAware
public class ConfigurationWatchList extends ContextAwareBase
This class manages the list of files and/or urls that are watched for changes.- Author:
- Ceki Gülcü
-
-
Field Summary
Fields Modifier and Type Field Description static StringFILE_PROTOCOL_STRstatic StringHTTP_PROTOCOL_STRstatic StringHTTPS_PROTOCOL_STR-
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase
context
-
-
Constructor Summary
Constructors Constructor Description ConfigurationWatchList()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddToWatchList(URL url)Add the url but only if it is file:// or http(s)://ConfigurationWatchListbuildClone()FilechangeDetected()Deprecated.replaced bychangeDetectedInFile()FilechangeDetectedInFile()Has a changed been detected in one of the files being watched?URLchangeDetectedInURL()voidclear()booleanemptyWatchLists()List<File>getCopyOfFileWatchList()StringgetFileWatchListAsStr()Returns the fileWatchList field as a StringURLgetTopURL()StringgetUrlWatchListAsStr()Returns the urlWatchList field as a StringbooleanhasAtLeastOneWatchableFile()Returns true if there are watchable files, false otherwise.static booleanisWatchableProtocol(String protocolStr)Is the given protocol a protocol that we can watch for.static booleanisWatchableProtocol(URL url)Is protocol for the given URL a protocol that we can watch for.voidsetTopURL(URL topURL)The topURL for the configuration file.booleanwatchPredicateFulfilled()-
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext
-
-
-
-
Field Detail
-
HTTPS_PROTOCOL_STR
public static final String HTTPS_PROTOCOL_STR
- See Also:
- Constant Field Values
-
HTTP_PROTOCOL_STR
public static final String HTTP_PROTOCOL_STR
- See Also:
- Constant Field Values
-
FILE_PROTOCOL_STR
public static final String FILE_PROTOCOL_STR
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ConfigurationWatchList
public ConfigurationWatchList()
-
-
Method Detail
-
buildClone
public ConfigurationWatchList buildClone()
-
clear
public void clear()
-
setTopURL
public void setTopURL(URL topURL)
The topURL for the configuration file. Null values are allowed.- Parameters:
topURL-
-
watchPredicateFulfilled
public boolean watchPredicateFulfilled()
-
addToWatchList
public void addToWatchList(URL url)
Add the url but only if it is file:// or http(s)://- Parameters:
url- should be a file or http(s)
-
getCopyOfFileWatchList
public List<File> getCopyOfFileWatchList()
-
emptyWatchLists
public boolean emptyWatchLists()
-
changeDetected
public File changeDetected()
Deprecated.replaced bychangeDetectedInFile()
-
changeDetectedInFile
public File changeDetectedInFile()
Has a changed been detected in one of the files being watched?- Returns:
-
changeDetectedInURL
public URL changeDetectedInURL()
-
hasAtLeastOneWatchableFile
public boolean hasAtLeastOneWatchableFile()
Returns true if there are watchable files, false otherwise.- Returns:
- true if there are watchable files, false otherwise.
- Since:
- 1.5.8
-
isWatchableProtocol
public static boolean isWatchableProtocol(URL url)
Is protocol for the given URL a protocol that we can watch for.- Parameters:
url-- Returns:
- true if watchable, false otherwise
- Since:
- 1.5.9
-
isWatchableProtocol
public static boolean isWatchableProtocol(String protocolStr)
Is the given protocol a protocol that we can watch for.- Parameters:
protocolStr-- Returns:
- true if watchable, false otherwise
- Since:
- 1.5.9
-
getUrlWatchListAsStr
public String getUrlWatchListAsStr()
Returns the urlWatchList field as a String- Returns:
- the urlWatchList field as a String
- Since:
- 1.5.19
-
getFileWatchListAsStr
public String getFileWatchListAsStr()
Returns the fileWatchList field as a String- Returns:
- the fileWatchList field as a String
- Since:
- 1.5.19
-
-