public abstract class AbstractCachedContentStoreAdapter extends Object implements ContentStoreAdapter
ContentStoreAdapter that provides caching to actual implementations. Subclasses just have to
implement the do* methods to provide the cacheable objects. Caching works the following way: when an
interface method is called, and there's no cached object associated to the parameter-based compound key, the do*
method of the same name is called to execute the actual method code. The returned object is then cached with the
compound key.| Modifier and Type | Field and Description |
|---|---|
protected CacheTemplate |
cacheTemplate |
static String |
CONST_KEY_ELEM_CONTENT |
static String |
CONST_KEY_ELEM_ITEM |
static String |
CONST_KEY_ELEM_ITEMS |
protected CachingOptions |
defaultCachingOptions |
| Constructor and Description |
|---|
AbstractCachedContentStoreAdapter() |
| Modifier and Type | Method and Description |
|---|---|
protected abstract Content |
doFindContent(Context context,
CachingOptions cachingOptions,
String path) |
protected abstract Item |
doFindItem(Context context,
CachingOptions cachingOptions,
String path,
boolean withDescriptor) |
protected abstract List<Item> |
doFindItems(Context context,
CachingOptions cachingOptions,
String path,
boolean withDescriptor) |
Content |
findContent(Context context,
CachingOptions cachingOptions,
String path) |
Item |
findItem(Context context,
CachingOptions cachingOptions,
String path,
boolean withDescriptor) |
List<Item> |
findItems(Context context,
CachingOptions cachingOptions,
String path,
boolean withDescriptor) |
void |
setCacheTemplate(CacheTemplate cacheTemplate) |
void |
setDefaultCachingOptions(CachingOptions defaultCachingOptions) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateContext, destroyContext, exists, validatepublic static final String CONST_KEY_ELEM_CONTENT
public static final String CONST_KEY_ELEM_ITEM
public static final String CONST_KEY_ELEM_ITEMS
protected CacheTemplate cacheTemplate
protected CachingOptions defaultCachingOptions
public void setCacheTemplate(CacheTemplate cacheTemplate)
public void setDefaultCachingOptions(CachingOptions defaultCachingOptions)
public Content findContent(Context context, CachingOptions cachingOptions, String path) throws InvalidContextException, StoreException
findContent in interface ContentStoreAdapterInvalidContextExceptionStoreExceptionpublic Item findItem(Context context, CachingOptions cachingOptions, String path, boolean withDescriptor) throws InvalidContextException, XmlFileParseException, StoreException
findItem in interface ContentStoreAdapterInvalidContextExceptionXmlFileParseExceptionStoreExceptionpublic List<Item> findItems(Context context, CachingOptions cachingOptions, String path, boolean withDescriptor) throws InvalidContextException, XmlFileParseException, StoreException
findItems in interface ContentStoreAdapterInvalidContextExceptionXmlFileParseExceptionStoreExceptionprotected abstract Content doFindContent(Context context, CachingOptions cachingOptions, String path) throws InvalidContextException, StoreException
protected abstract Item doFindItem(Context context, CachingOptions cachingOptions, String path, boolean withDescriptor) throws InvalidContextException, XmlFileParseException, StoreException
protected abstract List<Item> doFindItems(Context context, CachingOptions cachingOptions, String path, boolean withDescriptor) throws InvalidContextException, XmlFileParseException, StoreException
Copyright © 2018 CrafterCMS. All rights reserved.