public abstract class AbstractCachedObjectPersister extends AbstractObjectPersister implements CachedPersister
| Modifier and Type | Field and Description |
|---|---|
protected long |
cacheDelay |
protected int |
cacheMaxSize |
protected Map<String,ContentCache<ModelObject>> |
caches |
protected static String |
GLOBAL_STORE_ID_SUFFIX |
protected boolean |
useCache |
MODELOBJECT_CLASSES| Constructor and Description |
|---|
AbstractCachedObjectPersister()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
cachePut(ModelPersistenceContext context,
ModelObject obj)
Places an object into this persister's cache.
|
protected void |
cacheRemove(ModelPersistenceContext context,
ModelObject obj)
Removes an object from the cache
|
protected abstract ContentCache<ModelObject> |
createCache()
Creates a new cache.
|
protected abstract ContentCache<ModelObject> |
getCache(ModelPersistenceContext context,
String bucket)
Gets the cache for a particular model persistence context
|
void |
invalidateCache()
Invalidates the cache
|
void |
setCache(boolean useCache)
Enables or disables the caching mechanics
|
void |
setCacheCheckDelay(int cacheCheckDelay)
Sets the number of seconds to wait between cache checks, -1 for never.
|
void |
setCacheMaxSize(int cacheMaxSize)
Sets the maximum size of the underlying cache, -1 for no max size.
|
disable, getId, getPersisterService, getServiceRegistry, getWebFrameworkConfiguration, hasObject, init, isEnabled, removeObject, reset, setBeanName, setPersisterService, setServiceRegistry, setWebFrameworkConfigclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAllObjects, getAllObjectsByFilter, getObject, getTimestamp, hasObject, hasReadOnlyStore, newObject, removeObject, saveObject, saveObjectsprotected static final String GLOBAL_STORE_ID_SUFFIX
protected final Map<String,ContentCache<ModelObject>> caches
protected boolean useCache
protected long cacheDelay
protected int cacheMaxSize
protected abstract ContentCache<ModelObject> getCache(ModelPersistenceContext context, String bucket)
context - ModelPersistenceContextbucket - Cache bucket to pickprotected abstract ContentCache<ModelObject> createCache()
protected void cachePut(ModelPersistenceContext context, ModelObject obj)
context - the contextobj - the objprotected void cacheRemove(ModelPersistenceContext context, ModelObject obj)
context - the contextobj - ModelObjectpublic void setCache(boolean useCache)
CachedPersistersetCache in interface CachedPersisteruseCache - booleanCachedPersister.setCache(boolean)public void setCacheCheckDelay(int cacheCheckDelay)
CachedPersistersetCacheCheckDelay in interface CachedPersistercacheCheckDelay - intCachedPersister.setCacheCheckDelay(int)public void setCacheMaxSize(int cacheMaxSize)
CachedPersistersetCacheMaxSize in interface CachedPersistercacheMaxSize - intCachedPersister.setCacheMaxSize(int)public void invalidateCache()
CachedPersisterinvalidateCache in interface CachedPersisterCachedPersister.invalidateCache()Copyright © 2005–2016 Alfresco Software. All rights reserved.