public abstract class PortalCache extends Object
Modifier and Type | Field and Description |
---|---|
protected static boolean |
allowSetCacheClass
remember if the cacheClass has already been set to prevent
re-initialisation
|
protected static Class<? extends PortalCache> |
cacheClass
Class of the concrete Cache implementation
|
protected static Constructor<? extends PortalCache> |
cacheClassConstructor
Constructor for the concrete implementation
|
protected static boolean |
disableCache
Defines if cache is disabled.
|
protected String |
region
Region of the cache instance
|
Constructor and Description |
---|
PortalCache(String region)
create an instance for the given region
|
Modifier and Type | Method and Description |
---|---|
abstract void |
clear()
clears the whole cache
|
abstract void |
clearGroup(String groupName)
clears the a group in the cache
|
abstract Object |
get(Object key)
retrieve an object from the cache
|
static PortalCache |
getCache(String region)
retrieve a PortalCache instance
|
abstract PortalCacheAttributes |
getCacheAttributes(Object key)
get the cache attributes for a cached entry.
|
abstract PortalCacheAttributes |
getCacheAttributes(String groupName,
Object key)
get the cache attributes for a cached entry in a group.
|
abstract PortalCacheAttributes |
getDefaultCacheAttributes()
Get the default cache attributes
|
abstract Object |
getFromGroup(String groupName,
Object key)
Retrieven an object from the group in the cache
|
String |
getRegion()
Get the name of the region of this cache instance.
|
abstract void |
put(Object key,
Object object)
put an object into the cache
|
abstract void |
put(Object key,
Object object,
PortalCacheAttributes attribs)
put an object into the cache, using some attributes to define caching
methods.
|
abstract void |
putIntoGroup(String groupName,
Object key,
Object object)
Put an object into a group of the cache
|
abstract void |
putIntoGroup(String groupName,
Object key,
Object object,
PortalCacheAttributes attribs)
put an object into the a group in the cache, using some attributes to
define caching methods.
|
abstract void |
remove(Object key)
remove an object from the cache
|
abstract void |
removeFromGroup(String groupName,
Object key)
remove an object from a group in the cache
|
static void |
setCacheClass(String cacheClass)
sets the cache class to be used
|
protected static Constructor<? extends PortalCache> cacheClassConstructor
protected static boolean disableCache
protected static Class<? extends PortalCache> cacheClass
protected static boolean allowSetCacheClass
protected String region
public PortalCache(String region)
region
- cache regionpublic static PortalCache getCache(String region) throws PortalCacheException
region
- cache regionPortalCacheException
- when the cache cannot be instantiatedpublic static void setCacheClass(String cacheClass) throws PortalCacheException
cacheClass
- to be used, null for default implementationPortalCacheException
- if the cache class is already setpublic String getRegion()
public abstract Object get(Object key) throws PortalCacheException
key
- of the objectPortalCacheException
- when the cache cannot be accessedpublic abstract Object getFromGroup(String groupName, Object key) throws PortalCacheException
groupName
- group namekey
- key of the objectPortalCacheException
- when the cache cannot be accessedpublic abstract void put(Object key, Object object) throws PortalCacheException
key
- of the objectobject
- to put inside the cachePortalCacheException
- when the cache cannot be accessedpublic abstract void putIntoGroup(String groupName, Object key, Object object) throws PortalCacheException
groupName
- name of the groupkey
- key of the objectobject
- from the cache or nullPortalCacheException
- when the cache cannot be accessedpublic abstract void put(Object key, Object object, PortalCacheAttributes attribs) throws PortalCacheException
key
- the key of the entry.object
- the object to put inside the cache.attribs
- the cache element attributes for the object.PortalCacheException
- when the cache cannot be accessedpublic abstract void putIntoGroup(String groupName, Object key, Object object, PortalCacheAttributes attribs) throws PortalCacheException
groupName
- group namekey
- the key of the entry.object
- the object to put inside the cache.attribs
- the cache element attributes for the object.PortalCacheException
- when the cache cannot be accessedpublic abstract PortalCacheAttributes getDefaultCacheAttributes() throws PortalCacheException
PortalCacheException
- when the cache cannot be accessedpublic abstract PortalCacheAttributes getCacheAttributes(Object key) throws PortalCacheException
key
- the key of the entry.PortalCacheException
- when the cache cannot be accessedpublic abstract PortalCacheAttributes getCacheAttributes(String groupName, Object key) throws PortalCacheException
groupName
- group namekey
- the key of the entry.PortalCacheException
- when the cache cannot be accessedpublic abstract void remove(Object key) throws PortalCacheException
key
- of object to be removedPortalCacheException
- when the cache cannot be accessedpublic abstract void removeFromGroup(String groupName, Object key) throws PortalCacheException
groupName
- group namekey
- of object to be removedPortalCacheException
- when the cache cannot be accessedpublic abstract void clear() throws PortalCacheException
PortalCacheException
- when the cache cannot be accessedpublic abstract void clearGroup(String groupName) throws PortalCacheException
groupName
- group namePortalCacheException
- when the cache cannot be accessedCopyright © 2017 Gentics Software. All Rights Reserved.