|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fjank.jcache.CacheImpl
public final class CacheImpl
Contains several usefull methods for configuring, administering and monitoring the Cache. Is final to avoid subclassing to further lock down the singleton pattern.
Method Summary | |
---|---|
void |
close()
will mark the cache as "not ready" and shutdown the cache. |
void |
destroyRegion(Object name)
Will invalidate all objects in the named region and the named region. |
void |
flush()
will mark all objects in the cache, both disk and memory, as invalid, forcing objects to be reloaded. |
void |
flushDisk()
wll mark all objects in the cache as invalid, forcing objects to be reloaded. |
void |
flushMemory()
will mark all objects in the cache as invalid, forcing objects to be reloaded. |
CacheAttributes |
getAttributes()
returns the current attributes of the cache including the cache version number, wether the cache is local or distributed, the maximum number of objects in the cache, the disk cache location, and the disk cache size. |
static CacheImpl |
getCache(boolean init)
Gets an instance of the Cache class. |
DistributionEngine |
getDistributionEngine()
|
org.fjank.jcache.JCacheExecutorPool |
getExecPool()
|
ReferenceQueue |
getReferenceQueue()
gets the ReferenceQueue. |
CacheRegion |
getRegion()
Gets the default region in this cache., |
CacheRegion |
getRegion(Object name)
Gets the named region in this cache., |
float |
getVersion()
returns the current version of the cache. |
void |
init(CacheAttributes attributes)
initializes the cache, allocates space for metadata and starts the service threads. |
boolean |
isDistributed()
returns true if the cache is currently in distributed mode, that it is distributing updates and invalidates within the site, false if all cache actions are local only. |
boolean |
isReady()
returns true if the cache has been initialized and not closed, false otherwise. |
Enumeration |
listCacheObjects()
will return an Enumeration of CacheObjectInfo objects describing the objects in all regions in the cache. |
Enumeration |
listCacheObjects(String region)
will return an Enumeration of CacheObjectInfo objects describing the objects in the specified in the cache. |
void |
open()
will create a CacheAttributes object based on the values in a Java properties file, then call the method init. |
void |
open(String configFile)
will create a CacheAttributes object based on the values in a Java properties file, then call the method init. |
void |
setLogSeverity(int severity)
sets the log severity of the cache system. |
String |
toString()
returns a String representation of this Cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static CacheImpl getCache(boolean init)
init
- a boolean inication wether to actually performe the
initialization or not
CacheNotAvailableException
- if the Cache is not available.public CacheRegion getRegion()
public CacheRegion getRegion(Object name)
name
- the name of the region to get.
public void destroyRegion(Object name)
name
- the name of the region to destroy.#destroy()
public void init(CacheAttributes attributes) throws CacheNotAvailableException
init
in interface Cache
attributes2
- contains configuration information to initialize the
cache system.
CacheNotAvailableException
- if the cache is not available.public void open() throws CacheNotAvailableException
open
in interface Cache
CacheNotAvailableException
- if the cache is not available.public void open(String configFile)
open
in interface Cache
configFile
- the name of the configuration file.
CacheNotAvailableException
- if the cache is not available.public void close()
close
in interface Cache
public void flush() throws CacheException
flush
in interface Cache
CacheException
- if an error occurs.public void flushMemory() throws CacheException
flushMemory
in interface Cache
CacheException
- if an error occurs.public void flushDisk() throws CacheException
flushDisk
in interface Cache
CacheException
- if an error occurs.public float getVersion()
getVersion
in interface Cache
public boolean isReady()
isReady
in interface Cache
public boolean isDistributed()
isDistributed
in interface Cache
public Enumeration listCacheObjects()
listCacheObjects
in interface Cache
public Enumeration listCacheObjects(String region) throws RegionNotFoundException
listCacheObjects
in interface Cache
region
- the region to get the Enumeration for.
RegionNotFoundException
- if the named region os not present in
the cache.public CacheAttributes getAttributes()
getAttributes
in interface Cache
CacheNotAvailableException
- if the cache is not ready.public void setLogSeverity(int severity)
setLogSeverity
in interface Cache
severity
- the severity level to setpublic String toString()
toString
in class Object
public ReferenceQueue getReferenceQueue()
public org.fjank.jcache.JCacheExecutorPool getExecPool()
public DistributionEngine getDistributionEngine()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |