org.equanda.cache
Class EquandaCache<OBJECT>

java.lang.Object
  extended by org.equanda.cache.EquandaCache<OBJECT>

public abstract class EquandaCache<OBJECT>
extends Object

Get an instance of the equanda used instance of the JBoss treecache, used for caching various information

Author:
Joachim Van der Auwera

Field Summary
static int SEARCH_FIRST_IN_CACHE
           
static int SEARCH_FIRST_IN_DB
           
 
Constructor Summary
protected EquandaCache()
           
 
Method Summary
 OBJECT get(String key)
           
protected  OBJECT get(String key, int depth)
           
protected abstract  OBJECT getObject(String key)
          Get value from DB when not in cache, should be overwritten by child classes
 void set(String key, OBJECT value)
           
protected  void setObject(String key, OBJECT value)
          Set value in DB
 OBJECT update(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEARCH_FIRST_IN_DB

public static final int SEARCH_FIRST_IN_DB
See Also:
Constant Field Values

SEARCH_FIRST_IN_CACHE

public static final int SEARCH_FIRST_IN_CACHE
See Also:
Constant Field Values
Constructor Detail

EquandaCache

protected EquandaCache()
Method Detail

getObject

protected abstract OBJECT getObject(String key)
                             throws EquandaException
Get value from DB when not in cache, should be overwritten by child classes

Parameters:
key - key
Returns:
value loaded from the non-cache location
Throws:
EquandaException - oops

setObject

protected void setObject(String key,
                         OBJECT value)
                  throws EquandaException
Set value in DB

Parameters:
key - key
value - value
Throws:
EquandaException - problems

get

public OBJECT get(String key)
           throws EquandaException
Throws:
EquandaException

get

protected OBJECT get(String key,
                     int depth)
              throws EquandaException
Throws:
EquandaException

set

public void set(String key,
                OBJECT value)
         throws EquandaException
Throws:
EquandaException

update

public OBJECT update(String key)
              throws EquandaException
Throws:
EquandaException


Copyright © 2007-2009. All Rights Reserved.