com.easyjf.cache
Class EasyCache

java.lang.Object
  extended bycom.easyjf.cache.EasyCache
All Implemented Interfaces:
java.lang.Cloneable, ICache

public class EasyCache
extends java.lang.Object
implements ICache, java.lang.Cloneable


Field Summary
static java.lang.String DEFAULT_CACHE_NAME
           
 
Constructor Summary
EasyCache()
           
EasyCache(java.lang.String name, int storePolicy, int maxElements, long expiredInterval)
           
 
Method Summary
 void clear()
           
 java.lang.Object clone()
           
 void destroy()
           
 java.lang.Object get(java.lang.Object key)
           
 int getElementCount()
           
 long getExpiredInterval()
           
 java.util.Set getKeySet()
           
 int getMaxElemnetCount()
           
 java.lang.String getName()
           
 long getSize()
           
 int getStatus()
           
 int getStorePolicy()
           
 boolean isExpired(Element e)
           
 void lock(java.lang.Object key)
           
 void put(java.lang.Object key, java.lang.Object value)
           
 void remove(java.lang.Object key)
           
 void removeElement(java.lang.Object value)
           
 void setName(java.lang.String name)
           
 void unlock(java.lang.Object key)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CACHE_NAME

public static final java.lang.String DEFAULT_CACHE_NAME
See Also:
Constant Field Values
Constructor Detail

EasyCache

public EasyCache()

EasyCache

public EasyCache(java.lang.String name,
                 int storePolicy,
                 int maxElements,
                 long expiredInterval)
Method Detail

get

public java.lang.Object get(java.lang.Object key)
                     throws CacheException
Specified by:
get in interface ICache
Throws:
CacheException

put

public void put(java.lang.Object key,
                java.lang.Object value)
         throws CacheException
Specified by:
put in interface ICache
Throws:
CacheException

remove

public void remove(java.lang.Object key)
            throws CacheException
Specified by:
remove in interface ICache
Throws:
CacheException

clear

public void clear()
           throws CacheException
Specified by:
clear in interface ICache
Throws:
CacheException

destroy

public void destroy()
             throws CacheException
Specified by:
destroy in interface ICache
Throws:
CacheException

lock

public void lock(java.lang.Object key)
          throws CacheException
Specified by:
lock in interface ICache
Throws:
CacheException

unlock

public void unlock(java.lang.Object key)
            throws CacheException
Specified by:
unlock in interface ICache
Throws:
CacheException

getSize

public long getSize()
Specified by:
getSize in interface ICache

getStatus

public int getStatus()

getExpiredInterval

public long getExpiredInterval()

getElementCount

public int getElementCount()
Specified by:
getElementCount in interface ICache

getMaxElemnetCount

public int getMaxElemnetCount()
Specified by:
getMaxElemnetCount in interface ICache

getName

public java.lang.String getName()
Specified by:
getName in interface ICache

setName

public void setName(java.lang.String name)
Specified by:
setName in interface ICache

getStorePolicy

public int getStorePolicy()
Specified by:
getStorePolicy in interface ICache

isExpired

public boolean isExpired(Element e)
Specified by:
isExpired in interface ICache

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Specified by:
clone in interface ICache
Throws:
java.lang.CloneNotSupportedException

getKeySet

public java.util.Set getKeySet()
Specified by:
getKeySet in interface ICache

removeElement

public void removeElement(java.lang.Object value)
Specified by:
removeElement in interface ICache