public class MetaBeanCache extends Object implements MetaBeanFinder, Serializable
Modifier and Type | Field and Description |
---|---|
protected ConcurrentMap<Class<?>,MetaBean> |
cacheByClass
Cache keyed by class.
|
protected ConcurrentMap<String,MetaBean> |
cacheById
Cache keyed by id.
|
Constructor and Description |
---|
MetaBeanCache()
Create a new MetaBeanCache instance.
|
MetaBeanCache(Map<String,MetaBean> beans)
Create a new MetaBeanCache instance.
|
Modifier and Type | Method and Description |
---|---|
void |
cache(MetaBean beanInfo)
Cache the specified MetaBean.
|
void |
clear()
Clear the cache.
|
Map<String,MetaBean> |
findAll()
Return all cached MetaBeans by id.
|
MetaBean |
findForClass(Class<?> clazz)
Find the MetaBean for the specified class.
|
MetaBean |
findForId(String beanInfoId)
Find a MetaBean with a certain id.
|
void |
removeFromCache(MetaBean beanInfo)
Remove a single MetaBean from the cache.
|
protected final ConcurrentMap<String,MetaBean> cacheById
protected final ConcurrentMap<Class<?>,MetaBean> cacheByClass
public void clear()
public MetaBean findForId(String beanInfoId)
findForId
in interface MetaBeanFinder
beanInfoId
- - symbolic unique name of Meta Infopublic MetaBean findForClass(Class<?> clazz)
findForClass
in interface MetaBeanFinder
clazz
- - bean classpublic void cache(MetaBean beanInfo)
beanInfo
- public void removeFromCache(MetaBean beanInfo)
beanInfo
- Copyright © 2010–2019 The Apache Software Foundation. All rights reserved.