com.gentics.api.lib.cache
Class PortalCache

java.lang.Object
  extended by com.gentics.api.lib.cache.PortalCache

public abstract class PortalCache
extends Object

interface for various portal caches


Field Summary
protected static boolean allowSetCacheClass
          remember if the cacheClass has already been set to prevent re-initialisation
protected static Class cacheClass
           
protected static Constructor cacheClassConstructor
           
protected static boolean disableCache
          Defines if cache is disabled.
protected  String region
           
 
Constructor Summary
PortalCache(String region)
          create an instance for the given region
 
Method Summary
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  Object getFromGroup(String groupName, Object key)
          Retrieven an object from the group in the cache
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cacheClassConstructor

protected static Constructor cacheClassConstructor

region

protected String region

disableCache

protected static boolean disableCache
Defines if cache is disabled. Is set e.g. by JCSPortalCache during initialization if no cache.ccf could be found.


cacheClass

protected static Class cacheClass

allowSetCacheClass

protected static boolean allowSetCacheClass
remember if the cacheClass has already been set to prevent re-initialisation

Constructor Detail

PortalCache

public PortalCache(String region)
create an instance for the given region

Parameters:
region - cache region
Method Detail

getCache

public static PortalCache getCache(String region)
                            throws PortalCacheException
retrieve a PortalCache instance

Parameters:
region - cache region
Returns:
PortalCache instance
Throws:
PortalCacheException

setCacheClass

public static void setCacheClass(String cacheClass)
                          throws PortalCacheException
sets the cache class to be used

Parameters:
cacheClass - to be used, null for default implementation
Throws:
PortalCacheException

get

public abstract Object get(Object key)
                    throws PortalCacheException
retrieve an object from the cache

Parameters:
key - of the object
Returns:
object identified by key or null
Throws:
PortalCacheException

getFromGroup

public abstract Object getFromGroup(String groupName,
                                    Object key)
                             throws PortalCacheException
Retrieven an object from the group in the cache

Parameters:
groupName - group name
key - key of the object
Returns:
object from the cache or null
Throws:
PortalCacheException

put

public abstract void put(Object key,
                         Object object)
                  throws PortalCacheException
put an object into the cache

Parameters:
key - of the object
object - to put inside the cache
Throws:
PortalCacheException

putIntoGroup

public abstract void putIntoGroup(String groupName,
                                  Object key,
                                  Object object)
                           throws PortalCacheException
Put an object into a group of the cache

Parameters:
groupName - name of the group
key - key of the object
object - from the cache or null
Throws:
PortalCacheException

put

public abstract void put(Object key,
                         Object object,
                         PortalCacheAttributes attribs)
                  throws PortalCacheException
put an object into the cache, using some attributes to define caching methods.

Parameters:
key - the key of the entry.
object - the object to put inside the cache.
attribs - the cache element attributes for the object.
Throws:
PortalCacheException

putIntoGroup

public abstract void putIntoGroup(String groupName,
                                  Object key,
                                  Object object,
                                  PortalCacheAttributes attribs)
                           throws PortalCacheException
put an object into the a group in the cache, using some attributes to define caching methods.

Parameters:
groupName - group name
key - the key of the entry.
object - the object to put inside the cache.
attribs - the cache element attributes for the object.
Throws:
PortalCacheException

getCacheAttributes

public abstract PortalCacheAttributes getCacheAttributes(Object key)
                                                  throws PortalCacheException
get the cache attributes for a cached entry. If no attributes have been set, then null is returned.

Parameters:
key - the key of the entry.
Returns:
the cache attributes or null if not defined.
Throws:
PortalCacheException

getCacheAttributes

public abstract PortalCacheAttributes getCacheAttributes(String groupName,
                                                         Object key)
                                                  throws PortalCacheException
get the cache attributes for a cached entry in a group. If no attributes have been set, then null is returned.

Parameters:
groupName - group name
key - the key of the entry.
Returns:
the cache attributes or null if not defined.
Throws:
PortalCacheException

remove

public abstract void remove(Object key)
                     throws PortalCacheException
remove an object from the cache

Parameters:
key - of object to be removed
Throws:
PortalCacheException

removeFromGroup

public abstract void removeFromGroup(String groupName,
                                     Object key)
                              throws PortalCacheException
remove an object from a group in the cache

Parameters:
groupName - group name
key - of object to be removed
Throws:
PortalCacheException

clear

public abstract void clear()
                    throws PortalCacheException
clears the whole cache

Throws:
PortalCacheException

clearGroup

public abstract void clearGroup(String groupName)
                         throws PortalCacheException
clears the a group in the cache

Parameters:
groupName - group name
Throws:
PortalCacheException


Copyright © 2013 Gentics Software GmbH. All Rights Reserved.