|
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.services.EntityCachingService
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.
Method Summary | |
void |
add(IBasicEntity ent)
Adds the entity to the cache. |
IBasicEntity |
get(java.lang.Class type,
java.lang.String key)
Returns the cached entity identified by type and key. |
IBasicEntity |
get(EntityIdentifier entityID)
Returns the cached entity referred to by entityID. |
static EntityCachingService |
instance()
|
void |
remove(java.lang.Class type,
java.lang.String key)
Removes the entity identified by type and key from the cache and notifies peer caches. |
void |
remove(EntityIdentifier entityID)
Removes the entity referred to by entityID from the cache and notifies peer caches. |
void |
remove(IBasicEntity ent)
Removes the IBasicEntity from the cache and notifies peer
caches. |
static EntityCachingService |
start()
|
void |
update(IBasicEntity ent)
Updates the entity in the cache and notifies peer caches. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void add(IBasicEntity ent) throws CachingException
ent
- org.jasig.portal.IBasicEntity
CachingException
public IBasicEntity get(java.lang.Class type, java.lang.String key) throws CachingException
type
- Classkey
- String
CachingException
public IBasicEntity get(EntityIdentifier entityID) throws CachingException
entityID
- entity identifier
CachingException
public static EntityCachingService instance() throws CachingException
CachingException
public void remove(java.lang.Class type, java.lang.String key) throws CachingException
type
- Classkey
- String
CachingException
public void remove(EntityIdentifier entityID) throws CachingException
entityID
-
CachingException
public void remove(IBasicEntity ent) throws CachingException
IBasicEntity
from the cache and notifies peer
caches.
ent
- org.jasig.portal.IBasicEntity
CachingException
public static EntityCachingService start() throws CachingException
CachingException
public void update(IBasicEntity ent) throws CachingException
ent
- org.jasig.portal.concurrency.IBasicEntity
CachingException
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |