|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.red5.server.cache.WhirlyCacheImpl
public class WhirlyCacheImpl
Provides an implementation of an object cache using whirlycache.
| Field Summary | |
|---|---|
protected static org.slf4j.Logger |
log
|
| Constructor Summary | |
|---|---|
WhirlyCacheImpl()
|
|
| Method Summary | |
|---|---|
void |
destroy()
Shuts cache manager down |
ICacheable |
get(String name)
Returns cachable object by name |
static org.springframework.context.ApplicationContext |
getApplicationContext()
Returns Spring application context used by this class |
static long |
getCacheHit()
Returns cache hits stats |
static long |
getCacheMiss()
Returns cache misses stats |
Iterator<String> |
getObjectNames()
Iterate thru names of objects in cache. |
Iterator<SoftReference<? extends ICacheable>> |
getObjects()
Iterate thru names of objects in cache with soft reference. |
void |
init()
Initialazing method |
boolean |
offer(String name,
Object obj)
Stores object in the cache |
void |
put(String name,
Object obj)
Puts object in cache under given name, overloaded method. |
boolean |
remove(ICacheable obj)
Removes object from cache |
boolean |
remove(String name)
Removes object from cache by name |
void |
setApplicationContext(org.springframework.context.ApplicationContext context)
|
void |
setCacheConfig(com.whirlycott.cache.CacheConfiguration cacheConfig)
Sets cache configuration |
void |
setMaxEntries(int capacity)
Sets the maximum number of entries for the cache. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static org.slf4j.Logger log
| Constructor Detail |
|---|
public WhirlyCacheImpl()
| Method Detail |
|---|
public void setApplicationContext(org.springframework.context.ApplicationContext context)
throws org.springframework.beans.BeansException
setApplicationContext in interface org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic static org.springframework.context.ApplicationContext getApplicationContext()
public void init()
public ICacheable get(String name)
get in interface ICacheStorename - Object name
null if no such object was found
public void put(String name,
Object obj)
put in interface ICacheStorename - Nameobj - Object to store in cachepublic Iterator<String> getObjectNames()
getObjectNames in interface ICacheStorepublic Iterator<SoftReference<? extends ICacheable>> getObjects()
getObjects in interface ICacheStore
public boolean offer(String name,
Object obj)
offer in interface ICacheStorename - Name of stored objectobj - Object to store
public boolean remove(ICacheable obj)
remove in interface ICacheStoreobj - Object to remove from cache
public boolean remove(String name)
remove in interface ICacheStorename - Name of object to remove
public void setCacheConfig(com.whirlycott.cache.CacheConfiguration cacheConfig)
cacheConfig - Cache configurationpublic void setMaxEntries(int capacity)
ICacheStore
setMaxEntries in interface ICacheStorecapacity - upper-limit of the cachepublic static long getCacheHit()
public static long getCacheMiss()
public void destroy()
destroy in interface ICacheStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||