public class EhCacheImpl extends Object implements ICacheStore, org.springframework.context.ApplicationContextAware
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
Constructor and Description |
---|
EhCacheImpl() |
Modifier and Type | Method and Description |
---|---|
void |
destroy()
Allows for cleanup of a cache implementation.
|
ICacheable |
get(String name)
Return a cached object with the given name.
|
static org.springframework.context.ApplicationContext |
getApplicationContext()
Getter for property 'applicationContext'.
|
static long |
getCacheHit()
Getter for property 'cacheHit'.
|
net.sf.ehcache.event.CacheManagerEventListener |
getCacheManagerEventListener()
Getter for property 'cacheManagerEventListener'.
|
static long |
getCacheMiss()
Getter for property 'cacheMiss'.
|
int |
getDiskExpiryThreadIntervalSeconds()
Getter for property 'diskExpiryThreadIntervalSeconds'.
|
String |
getDiskStore()
Getter for property 'diskStore'.
|
String |
getMemoryStoreEvictionPolicy()
Getter for property 'memoryStoreEvictionPolicy'.
|
Iterator<String> |
getObjectNames()
Return iterator over the names of all already loaded objects in the
storage.
|
Iterator<SoftReference<? extends ICacheable>> |
getObjects()
Return iterator over the already loaded objects in the storage.
|
void |
init() |
boolean |
offer(String name,
Object obj)
Offer an object to the cache with an associated key.
|
void |
put(String name,
Object obj)
Puts an object in the cache with the associated key.
|
boolean |
remove(ICacheable obj)
Delete the passed cached object.
|
boolean |
remove(String name)
Delete the cached object with the given name.
|
void |
setApplicationContext(org.springframework.context.ApplicationContext context) |
void |
setCacheConfigs(List<net.sf.ehcache.config.CacheConfiguration> configs)
Setter for property 'cacheConfigs'.
|
void |
setCacheManagerEventListener(net.sf.ehcache.event.CacheManagerEventListener cacheManagerEventListener)
Setter for property 'cacheManagerEventListener'.
|
void |
setDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds)
Setter for property 'diskExpiryThreadIntervalSeconds'.
|
void |
setDiskStore(String diskStore)
Setter for property 'diskStore'.
|
void |
setMaxEntries(int capacity)
Sets the maximum number of entries for the cache.
|
void |
setMemoryStoreEvictionPolicy(String memoryStoreEvictionPolicy)
Setter for property 'memoryStoreEvictionPolicy'.
|
public void setApplicationContext(org.springframework.context.ApplicationContext context) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
org.springframework.beans.BeansException
public static org.springframework.context.ApplicationContext getApplicationContext()
public void init()
public ICacheable get(String name)
get
in interface ICacheStore
name
- the name of the object to returnnull
if no such object was foundpublic void put(String name, Object obj)
put
in interface ICacheStore
name
- string name representing the objectobj
- cacheable objectpublic Iterator<String> getObjectNames()
getObjectNames
in interface ICacheStore
public Iterator<SoftReference<? extends ICacheable>> getObjects()
getObjects
in interface ICacheStore
public boolean offer(String name, Object obj)
offer
in interface ICacheStore
name
- string name representing the objectobj
- cacheable objectpublic boolean remove(ICacheable obj)
remove
in interface ICacheStore
obj
- the object to deletepublic boolean remove(String name)
remove
in interface ICacheStore
name
- the name of the object to deletepublic void setCacheConfigs(List<net.sf.ehcache.config.CacheConfiguration> configs)
configs
- Value to set for property 'cacheConfigs'.public void setMaxEntries(int capacity)
setMaxEntries
in interface ICacheStore
capacity
- upper-limit of the cachepublic String getMemoryStoreEvictionPolicy()
public void setMemoryStoreEvictionPolicy(String memoryStoreEvictionPolicy)
memoryStoreEvictionPolicy
- Value to set for property 'memoryStoreEvictionPolicy'.public int getDiskExpiryThreadIntervalSeconds()
public void setDiskExpiryThreadIntervalSeconds(int diskExpiryThreadIntervalSeconds)
diskExpiryThreadIntervalSeconds
- Value to set for property 'diskExpiryThreadIntervalSeconds'.public String getDiskStore()
public void setDiskStore(String diskStore)
diskStore
- Value to set for property 'diskStore'.public net.sf.ehcache.event.CacheManagerEventListener getCacheManagerEventListener()
public void setCacheManagerEventListener(net.sf.ehcache.event.CacheManagerEventListener cacheManagerEventListener)
cacheManagerEventListener
- Value to set for property 'cacheManagerEventListener'.public static long getCacheHit()
public static long getCacheMiss()
public void destroy()
destroy
in interface ICacheStore
Copyright © 2006-2012 The Red5 Project