Package org.apache.wiki.providers
Class CachingProvider
java.lang.Object
org.apache.wiki.providers.CachingProvider
- All Implemented Interfaces:
PageProvider,WikiProvider
Provides a caching page provider. This class rests on top of a real provider class and provides a cache to speed things up. Only
if the cache copy of the page text has expired, we fetch it from the provider.
This class does not detect if someone has modified the page externally, not through JSPWiki routines.
Heavily based on ideas by Chris Brooking.
Since 2.10 uses the Ehcache library.
- Since:
- 1.6.4
-
Field Summary
Fields inherited from interface org.apache.wiki.api.providers.WikiProvider
LATEST_VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeletePage(String pageName) voiddeleteVersion(String pageName, int version) getAllChangedSince(Date date) intgetPageInfo(String pageName, int version) getPageText(String pageName, int version) Gets the provider class name, and cache statistics (misscount and hitcount of page cache and history cache).Returns the actual used provider.getVersionHistory(String pageName) voidinitialize(Engine engine, Properties properties) voidbooleanpageExists(String pageName) booleanpageExists(String pageName, int version) voidputPageText(Page page, String text)
-
Constructor Details
-
CachingProvider
public CachingProvider()
-
-
Method Details
-
initialize
public void initialize(Engine engine, Properties properties) throws NoRequiredPropertyException, IOException - Specified by:
initializein interfaceWikiProvider- Throws:
NoRequiredPropertyExceptionIOException
-
pageExists
- Specified by:
pageExistsin interfacePageProvider
-
pageExists
- Specified by:
pageExistsin interfacePageProvider
-
getPageText
- Specified by:
getPageTextin interfacePageProvider- Throws:
ProviderException
-
putPageText
- Specified by:
putPageTextin interfacePageProvider- Throws:
ProviderException
-
getAllPages
- Specified by:
getAllPagesin interfacePageProvider- Throws:
ProviderException
-
getAllChangedSince
- Specified by:
getAllChangedSincein interfacePageProvider
-
getPageCount
- Specified by:
getPageCountin interfacePageProvider- Throws:
ProviderException
-
findPages
- Specified by:
findPagesin interfacePageProvider
-
getPageInfo
- Specified by:
getPageInfoin interfacePageProvider- Throws:
ProviderException
-
getVersionHistory
- Specified by:
getVersionHistoryin interfacePageProvider- Throws:
ProviderException
-
getProviderInfo
Gets the provider class name, and cache statistics (misscount and hitcount of page cache and history cache).- Specified by:
getProviderInfoin interfaceWikiProvider- Returns:
- A plain string with all the above-mentioned values.
-
deleteVersion
- Specified by:
deleteVersionin interfacePageProvider- Throws:
ProviderException
-
deletePage
- Specified by:
deletePagein interfacePageProvider- Throws:
ProviderException
-
movePage
- Specified by:
movePagein interfacePageProvider- Throws:
ProviderException
-
getRealProvider
Returns the actual used provider.- Returns:
- The real provider.
- Since:
- 2.0
-