|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.concurrency.caching.ReferenceEntityCache
Reference implementation of IEntityCache. Each cache holds entities of a single type in an LRUCache, a kind of HashMap. Synchronization for get(), add() and remove() is handled by the LRUCache. At intervals, the cleanupThread kicks off a sweep of the cache to trim it down to its maximum size.
LRUCache
Constructor Summary | |
ReferenceEntityCache(java.lang.Class type,
int maxSize,
int maxUnusedTime,
int sweepInterval)
ReferenceEntityCache constructor comment. |
Method Summary | |
void |
add(IBasicEntity entity)
Checks that entity is the same type as, i.e., could be cast
to, the cache type. |
void |
cleanupCache()
Remove stale entries from the cache. |
void |
clearCache()
Remove all entries from the cache. |
IBasicEntity |
get(java.lang.String key)
|
java.lang.Class |
getEntityType()
|
void |
remove(java.lang.String key)
|
int |
size()
Answers the number of entries in the cache. |
java.lang.String |
toString()
Returns a String that represents the value of this object. |
void |
update(IBasicEntity entity)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ReferenceEntityCache(java.lang.Class type, int maxSize, int maxUnusedTime, int sweepInterval) throws CachingException
Method Detail |
public void add(IBasicEntity entity) throws CachingException
entity
is the same type as, i.e., could be cast
to, the cache type.
add
in interface IEntityCache
entity
- the entity to be added to the cache.
CachingException
public void cleanupCache()
cleanupCache
in interface IEntityCache
public void clearCache()
clearCache
in interface IEntityCache
public IBasicEntity get(java.lang.String key)
get
in interface IEntityCache
key
- the key of the entity.
public final java.lang.Class getEntityType()
getEntityType
in interface IEntityCache
for known types.
public void remove(java.lang.String key) throws CachingException
remove
in interface IEntityCache
key
- the key of the entity to be un-cached.
CachingException
public int size()
IEntityCache
size
in interface IEntityCache
public java.lang.String toString()
public void update(IBasicEntity entity) throws CachingException
update
in interface IEntityCache
entity
- the entity to be updated in the cache.
CachingException
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |