org.jtheque.core.managers.cache
Class CacheManager

java.lang.Object
  extended by org.jtheque.core.managers.cache.CacheManager
All Implemented Interfaces:
ActivableManager, ICacheManager, IManager

public final class CacheManager
extends java.lang.Object
implements ICacheManager

A cache manager implementation.

Author:
Baptiste Wicht

Constructor Summary
CacheManager()
           
 
Method Summary
 void addCache(org.jtheque.core.managers.cache.CacheConfiguration config)
          Add a cache.
 boolean cacheExists(java.lang.String name)
          Indicate if a cache exists with the specified name or not.
 void close()
          Close the manager.
 net.sf.ehcache.Cache getCache(java.lang.String name)
          Return the cache with the specificied name.
 void init()
          Init the manager.
 boolean isEnabled()
          Indicate if the manager is enabled or not.
 void preInit()
          Pre-init the manager.
 void removeCache(java.lang.String name)
          Remove the cache with the specified name.
 void setEnabled(boolean enabled)
          Enable or disable the manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheManager

public CacheManager()
Method Detail

preInit

public void preInit()
Description copied from interface: IManager
Pre-init the manager. This operation is called before modules preplug.

Specified by:
preInit in interface IManager

init

public void init()
          throws ManagerException
Description copied from interface: IManager
Init the manager. This operation is called after modules preplug but before module plug.

Specified by:
init in interface IManager
Throws:
ManagerException - If an error occurs during the init process.

close

public void close()
           throws ManagerException
Description copied from interface: IManager
Close the manager.

Specified by:
close in interface IManager
Throws:
ManagerException - If an error occurs during the close process.

isEnabled

public boolean isEnabled()
Description copied from interface: ActivableManager
Indicate if the manager is enabled or not.

Specified by:
isEnabled in interface ActivableManager
Returns:
true if the manager is enabled else false.

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: ActivableManager
Enable or disable the manager.

Specified by:
setEnabled in interface ActivableManager
Parameters:
enabled - true if we want enable the manager else false.

addCache

public void addCache(org.jtheque.core.managers.cache.CacheConfiguration config)
Description copied from interface: ICacheManager
Add a cache.

Specified by:
addCache in interface ICacheManager
Parameters:
config - The configuration of the cache.

getCache

public net.sf.ehcache.Cache getCache(java.lang.String name)
Description copied from interface: ICacheManager
Return the cache with the specificied name.

Specified by:
getCache in interface ICacheManager
Parameters:
name - The name of the cache.
Returns:
The cache with the specified name.

cacheExists

public boolean cacheExists(java.lang.String name)
Description copied from interface: ICacheManager
Indicate if a cache exists with the specified name or not.

Specified by:
cacheExists in interface ICacheManager
Parameters:
name - The name of the cache to search for.
Returns:
true if the cache exists else false.

removeCache

public void removeCache(java.lang.String name)
Description copied from interface: ICacheManager
Remove the cache with the specified name.

Specified by:
removeCache in interface ICacheManager
Parameters:
name - The name of the cache to remove.


Copyright © 2009 JTheque. All Rights Reserved.