This class presents a facade for the IEntityCachingService implementation
that lets clients cache and retrieve IBasicEntities . It
hides such details as the physical structure of the cache and whether
it is running in a multi- or single-JVM environment.
An IBasicEntity can answer its type and key. (See
org.jasig.portal.groups.EntityTypes).
Caching consists of asking the service to add, retrieve, update and
remove elements from the cache, e.g.,
// Retrieve the entity from its store:
Class type = getEntityClass();
String key = getEntityKey();
IBasicEntity ent = findEntity(key);
...
// Cache the entity:
EntityCachingService.add(ent);
...
// Retrieve the entity from the cache:
IEntity aCopy = EntityCachingService.get(type, key);
...
// Update the entity and then:
EntityCachingService..update(aCopy); // notifies peer caches.
...
// Or delete the entity and:
EntityCachingService.remove(type, key); // notifies peer caches.
author: Dan Ellentuck version: $Revision: 35418 $ |