|
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
org.jasig.portal.concurrency.caching.ReferenceInvalidatingEntityCache
Reference implementation of IEntityCache
that is meant
for a multi-server environment in which updates to cached entities may
occur on peer caches on other JVMs, invalidating the local copy of the
entity.
Cache entries are wrapped in a CacheEntry
that records
their creation time. At intervals, cleanupCache() is called by the
cache's cleanup thread. When this happens, the class retrieves
invalidation notices from its invalidation store and purges stale entries.
A fudge factor (clockTolerance) is employed to account for differences in system clocks among servers. This may cause a valid entry to be removed from the cache if it is newer than the corresponding invalidation by less than the fudge factor. However, this should not be to frequent, and assuming the factor is appropriately set, all relevant invalidations should occur.
Constructor Summary | |
ReferenceInvalidatingEntityCache(java.lang.Class type,
int maxSize,
int maxUnusedTime,
int sweepInterval)
ReferenceInvalidatingEntityCache constructor comment. |
|
ReferenceInvalidatingEntityCache(java.lang.Class type,
int maxSize,
int maxUnusedTime,
int sweepInterval,
int clock)
ReferenceInvalidatingEntityCache constructor comment. |
Method Summary | |
void |
add(IBasicEntity entity)
Wrap the incoming entity and add to the cache. |
void |
cleanupCache()
Remove stale entries from the cache. |
IBasicEntity |
get(java.lang.String key)
Unwraps and returns the cached entity. |
int |
getCacheID()
|
void |
invalidate(IBasicEntity entity)
|
void |
remove(java.lang.String key)
|
void |
removeInvalidEntities()
Retrieves invalidations that were added to the store by other caches since the last time we checked (fudged with the clockTolerance). |
java.lang.String |
toString()
Returns a String that represents the value of this object. |
void |
update(IBasicEntity entity)
First invalidate, then cache the incoming entity. |
Methods inherited from class org.jasig.portal.concurrency.caching.ReferenceEntityCache |
clearCache, getEntityType, size |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public ReferenceInvalidatingEntityCache(java.lang.Class type, int maxSize, int maxUnusedTime, int sweepInterval, int clock) throws CachingException
public ReferenceInvalidatingEntityCache(java.lang.Class type, int maxSize, int maxUnusedTime, int sweepInterval) throws CachingException
Method Detail |
public void add(IBasicEntity entity) throws CachingException
add
in interface IEntityCache
add
in class ReferenceEntityCache
entity
- the entity to be added to the cache.
CachingException
public void cleanupCache()
cleanupCache
in interface IEntityCache
cleanupCache
in class ReferenceEntityCache
public IBasicEntity get(java.lang.String key)
get
in interface IEntityCache
get
in class ReferenceEntityCache
key
- - the key of the entity.
public void invalidate(IBasicEntity entity) throws CachingException
entity
- org.jasig.portal.IBasicEntity
CachingException
public void remove(java.lang.String key) throws CachingException
remove
in interface IEntityCache
remove
in class ReferenceEntityCache
key
- - the key of the entity to be un-cached.
CachingException
public void removeInvalidEntities()
public java.lang.String toString()
toString
in class ReferenceEntityCache
public void update(IBasicEntity entity) throws CachingException
update
in interface IEntityCache
update
in class ReferenceEntityCache
entity
- the entity to be updated in the cache.
CachingException
public int getCacheID()
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |