public class CachingDocumentSource extends Object implements DocumentSource
DocumentSource implementations providing support for
caching loaded documents.| Constructor and Description |
|---|
CachingDocumentSource(DocumentSource delegate)
Constructor with the
DocumentSource to actually load documents. |
| Modifier and Type | Method and Description |
|---|---|
void |
clearCache()
Remove all entries from the document cache.
|
reactor.core.publisher.Mono<String> |
getDocument(String name)
Return the document that matches the given name.
|
boolean |
isCacheEnabled()
Whether
caching is enabled. |
void |
setCacheEnabled(boolean cacheEnabled)
Enable or disable caching of resolved documents.
|
public CachingDocumentSource(DocumentSource delegate)
DocumentSource to actually load documents.public void setCacheEnabled(boolean cacheEnabled)
By default, set to true.
cacheEnabled - enable if true and disable if falsepublic boolean isCacheEnabled()
caching is enabled.public reactor.core.publisher.Mono<String> getDocument(String name)
DocumentSourcegetDocument in interface DocumentSourcename - the name to use for the lookupMono that completes either with the document content or
with an error, but never empty.public void clearCache()