| java.lang.Object org.jasig.portal.concurrency.caching.ReferenceEntityCache
All known Subclasses: org.jasig.portal.concurrency.caching.ReferenceInvalidatingEntityCache,
ReferenceEntityCache | public class ReferenceEntityCache implements IEntityCache(Code) | | 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.
author: Dan Ellentuck version: $Revision: 36731 $ See Also: org.jasig.portal.concurrency.caching.LRUCache |
Inner Class :protected class CacheSweeper implements Runnable | |
Constructor Summary | |
public | ReferenceEntityCache(Class type, int maxSize, int maxUnusedTime, int sweepInterval) ReferenceEntityCache constructor comment. |
sweepIntervalMillis | protected int sweepIntervalMillis(Code) | | |
threadID | protected static int threadID(Code) | | |
ReferenceEntityCache | public ReferenceEntityCache(Class type, int maxSize, int maxUnusedTime, int sweepInterval) throws CachingException(Code) | | ReferenceEntityCache constructor comment.
|
add | public void add(IBasicEntity entity) throws CachingException(Code) | | Checks that entity is the same type as, i.e., could be cast
to, the cache type.
Parameters: entity - the entity to be added to the cache. |
cleanupCache | public void cleanupCache()(Code) | | Remove stale entries from the cache.
|
clearCache | public void clearCache()(Code) | | Remove all entries from the cache.
|
get | public IBasicEntity get(String key)(Code) | | Parameters: key - the key of the entity. org.jasig.portal.concurrency.IBasicEntity |
setCache | protected void setCache(java.util.Map newCache)(Code) | | Parameters: newCache - java.util.Map |
size | public int size()(Code) | | int |
toString | public String toString()(Code) | | Returns a String that represents the value of this object.
a string representation of the receiver |
|
|