public final class DefaultSimpleCache
extends java.lang.Object
implements org.alfresco.repo.cache.SimpleCache, org.springframework.beans.factory.BeanNameAware
SimpleCache implementation backed by a ConcurrentLinkedHashMap.| Constructor and Description |
|---|
DefaultSimpleCache()
Default constructor.
|
DefaultSimpleCache(int maxItems,
java.lang.String cacheName)
Construct a cache using the specified capacity and name.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
boolean |
contains(java.io.Serializable key) |
java.lang.Object |
get(java.io.Serializable key) |
java.util.Collection |
getKeys() |
void |
put(java.io.Serializable key,
java.lang.Object value) |
void |
remove(java.io.Serializable key) |
void |
setBeanName(java.lang.String cacheName)
Since there are many cache instances, it is useful to be able to associate
a name with each one.
|
void |
setMaxItems(int maxItems)
Sets the maximum number of items that the cache will hold.
|
java.lang.String |
toString() |
public DefaultSimpleCache(int maxItems,
java.lang.String cacheName)
maxItems - The cache capacity.public DefaultSimpleCache()
DefaultSimpleCache.DEFAULT_CAPACITY
and no name.public boolean contains(java.io.Serializable key)
contains in interface org.alfresco.repo.cache.SimpleCachepublic java.util.Collection getKeys()
getKeys in interface org.alfresco.repo.cache.SimpleCachepublic java.lang.Object get(java.io.Serializable key)
get in interface org.alfresco.repo.cache.SimpleCachepublic void put(java.io.Serializable key,
java.lang.Object value)
put in interface org.alfresco.repo.cache.SimpleCachepublic void remove(java.io.Serializable key)
remove in interface org.alfresco.repo.cache.SimpleCachepublic void clear()
clear in interface org.alfresco.repo.cache.SimpleCachepublic java.lang.String toString()
toString in class java.lang.Objectpublic void setMaxItems(int maxItems)
maxItems - public void setBeanName(java.lang.String cacheName)
setBeanName in interface org.springframework.beans.factory.BeanNameAwarecacheName - Set automatically by Spring, but can be set manually if required.Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.