org.nuiton.wikitty.services
Class WikittyCacheJCS

java.lang.Object
  extended by org.nuiton.wikitty.services.WikittyCacheJCS
All Implemented Interfaces:
WikittyCache

public class WikittyCacheJCS
extends Object
implements WikittyCache

Implantation du cache base sur le projet apache JCS

Version:
$Revision: 1136 $ Last update: $Date: 2011-08-12 16:24:03 +0200 (Fri, 12 Aug 2011) $ by : $Author: tchemit $
Author:
poussin

Field Summary
protected  org.apache.jcs.access.GroupCacheAccess extensionCache
          cache pour les extensions
protected  org.apache.jcs.access.GroupCacheAccess priorityCache
          cache ou sont stocke les objects qui doivent rester le plus possible en memoire
protected  Set<String> priorityExtensions
           
protected  org.apache.jcs.access.GroupCacheAccess wikittyCache
          cache pour les autres wikitties
 
Constructor Summary
WikittyCacheJCS(org.nuiton.util.ApplicationConfig config)
           
 
Method Summary
 void clearExtension()
          Clear all cache.
 void clearWikitty()
          Clear all cache.
 boolean existsExtension(String id)
           
 boolean existsWikitty(String id)
           
 WikittyExtension getExtension(String extId)
          Return wikitty object if is in the cache, null otherwise.
 Set<String> getPriorityExtensions()
          Liste des extensions a conserver prioritairement
 Wikitty getWikitty(String id)
          Return wikitty object if is in the cache, null otherwize.
 void putExtension(WikittyExtension e)
          Only realy put wikitty in cache, if not in cache or version is newer than one in cache
 void putWikitty(Wikitty e)
          Only realy put wikitty in cache, if not in cache or version is newer than one in cache
 void removeExtension(String extId)
          Remove wikitty from cache.
 void removeWikitty(String id)
          Remove wikitty from cache.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

priorityExtensions

protected Set<String> priorityExtensions

priorityCache

protected org.apache.jcs.access.GroupCacheAccess priorityCache
cache ou sont stocke les objects qui doivent rester le plus possible en memoire


wikittyCache

protected org.apache.jcs.access.GroupCacheAccess wikittyCache
cache pour les autres wikitties


extensionCache

protected org.apache.jcs.access.GroupCacheAccess extensionCache
cache pour les extensions

Constructor Detail

WikittyCacheJCS

public WikittyCacheJCS(org.nuiton.util.ApplicationConfig config)
Parameters:
config - not used currently but necessary in futur to configure the cache Create a soft cache.
Method Detail

getPriorityExtensions

public Set<String> getPriorityExtensions()
Liste des extensions a conserver prioritairement

Returns:

existsWikitty

public boolean existsWikitty(String id)
Specified by:
existsWikitty in interface WikittyCache

getWikitty

public Wikitty getWikitty(String id)
Return wikitty object if is in the cache, null otherwize.

Specified by:
getWikitty in interface WikittyCache
Parameters:
id -
Returns:
wikitty object or null

putWikitty

public void putWikitty(Wikitty e)
Only realy put wikitty in cache, if not in cache or version is newer than one in cache

Specified by:
putWikitty in interface WikittyCache
Parameters:
e -

removeWikitty

public void removeWikitty(String id)
Remove wikitty from cache.

Specified by:
removeWikitty in interface WikittyCache
Parameters:
id - wikitty id to remove

clearWikitty

public void clearWikitty()
Clear all cache.

Specified by:
clearWikitty in interface WikittyCache

existsExtension

public boolean existsExtension(String id)
Specified by:
existsExtension in interface WikittyCache

getExtension

public WikittyExtension getExtension(String extId)
Return wikitty object if is in the cache, null otherwise.

Specified by:
getExtension in interface WikittyCache
Parameters:
extId - extension id
Returns:
wikitty object or null

putExtension

public void putExtension(WikittyExtension e)
Only realy put wikitty in cache, if not in cache or version is newer than one in cache

Specified by:
putExtension in interface WikittyCache
Parameters:
e -

removeExtension

public void removeExtension(String extId)
Remove wikitty from cache.

Specified by:
removeExtension in interface WikittyCache
Parameters:
extId - wikitty id to remove

clearExtension

public void clearExtension()
Clear all cache.

Specified by:
clearExtension in interface WikittyCache


Copyright © 2009-2011 CodeLutin. All Rights Reserved.