public abstract class PortalCache
extends java.lang.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 java.lang.Class<? extends PortalCache> |
cacheClass
Class of the concrete Cache implementation
|
protected static java.lang.reflect.Constructor<? extends PortalCache> |
cacheClassConstructor
Constructor for the concrete implementation
|
protected static boolean |
disableCache
Defines if cache is disabled.
|
protected java.lang.String |
region
Region of the cache instance
|
Constructor and Description |
---|
PortalCache(java.lang.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(java.lang.String groupName)
clears the a group in the cache
|
abstract java.lang.Object |
get(java.lang.Object key)
retrieve an object from the cache
|
static PortalCache |
getCache(java.lang.String region)
retrieve a PortalCache instance
|
abstract PortalCacheAttributes |
getCacheAttributes(java.lang.Object key)
get the cache attributes for a cached entry.
|
abstract PortalCacheAttributes |
getCacheAttributes(java.lang.String groupName,
java.lang.Object key)
get the cache attributes for a cached entry in a group.
|
abstract PortalCacheAttributes |
getDefaultCacheAttributes()
Get the default cache attributes
|
abstract java.lang.Object |
getFromGroup(java.lang.String groupName,
java.lang.Object key)
Retrieven an object from the group in the cache
|
java.lang.String |
getRegion()
Get the name of the region of this cache instance.
|
abstract void |
put(java.lang.Object key,
java.lang.Object object)
put an object into the cache
|
abstract void |
put(java.lang.Object key,
java.lang.Object object,
PortalCacheAttributes attribs)
put an object into the cache, using some attributes to define caching
methods.
|
abstract void |
putIntoGroup(java.lang.String groupName,
java.lang.Object key,
java.lang.Object object)
Put an object into a group of the cache
|
abstract void |
putIntoGroup(java.lang.String groupName,
java.lang.Object key,
java.lang.Object object,
PortalCacheAttributes attribs)
put an object into the a group in the cache, using some attributes to
define caching methods.
|
abstract void |
remove(java.lang.Object key)
remove an object from the cache
|
abstract void |
removeFromGroup(java.lang.String groupName,
java.lang.Object key)
remove an object from a group in the cache
|
static void |
setCacheClass(java.lang.String cacheClass)
sets the cache class to be used
|
protected static java.lang.reflect.Constructor<? extends PortalCache> cacheClassConstructor
protected static boolean disableCache
protected static java.lang.Class<? extends PortalCache> cacheClass
protected static boolean allowSetCacheClass
protected java.lang.String region
public PortalCache(java.lang.String region)
region
- cache regionpublic static PortalCache getCache(java.lang.String region) throws PortalCacheException
region
- cache regionPortalCacheException
- when the cache cannot be instantiatedpublic static void setCacheClass(java.lang.String cacheClass) throws PortalCacheException
cacheClass
- to be used, null for default implementationPortalCacheException
- if the cache class is already setpublic java.lang.String getRegion()
public abstract java.lang.Object get(java.lang.Object key) throws PortalCacheException
key
- of the objectPortalCacheException
- when the cache cannot be accessedpublic abstract java.lang.Object getFromGroup(java.lang.String groupName, java.lang.Object key) throws PortalCacheException
groupName
- group namekey
- key of the objectPortalCacheException
- when the cache cannot be accessedpublic abstract void put(java.lang.Object key, java.lang.Object object) throws PortalCacheException
key
- of the objectobject
- to put inside the cachePortalCacheException
- when the cache cannot be accessedpublic abstract void putIntoGroup(java.lang.String groupName, java.lang.Object key, java.lang.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(java.lang.Object key, java.lang.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(java.lang.String groupName, java.lang.Object key, java.lang.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(java.lang.Object key) throws PortalCacheException
key
- the key of the entry.PortalCacheException
- when the cache cannot be accessedpublic abstract PortalCacheAttributes getCacheAttributes(java.lang.String groupName, java.lang.Object key) throws PortalCacheException
groupName
- group namekey
- the key of the entry.PortalCacheException
- when the cache cannot be accessedpublic abstract void remove(java.lang.Object key) throws PortalCacheException
key
- of object to be removedPortalCacheException
- when the cache cannot be accessedpublic abstract void removeFromGroup(java.lang.String groupName, java.lang.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(java.lang.String groupName) throws PortalCacheException
groupName
- group namePortalCacheException
- when the cache cannot be accessedCopyright © 2018 Gentics Software. All Rights Reserved.