uPortal 2.4.1
API Documentation

org.jasig.portal.services
Class EntityCachingService

java.lang.Object
  extended byorg.jasig.portal.services.EntityCachingService

public class EntityCachingService
extends java.lang.Object

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.

Version:
$Revision: 1.9 $
Author:
Dan Ellentuck

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

add

public void add(IBasicEntity ent)
         throws CachingException
Adds the entity to the cache.

Parameters:
ent - org.jasig.portal.IBasicEntity
Throws:
CachingException

get

public IBasicEntity get(java.lang.Class type,
                        java.lang.String key)
                 throws CachingException
Returns the cached entity identified by type and key.

Parameters:
type - Class
key - String
Returns:
IBasicEntity entity
Throws:
CachingException

get

public IBasicEntity get(EntityIdentifier entityID)
                 throws CachingException
Returns the cached entity referred to by entityID.

Parameters:
entityID - entity identifier
Returns:
IBasicEntity entity
Throws:
CachingException

instance

public static EntityCachingService instance()
                                     throws CachingException
Throws:
CachingException

remove

public void remove(java.lang.Class type,
                   java.lang.String key)
            throws CachingException
Removes the entity identified by type and key from the cache and notifies peer caches.

Parameters:
type - Class
key - String
Throws:
CachingException

remove

public void remove(EntityIdentifier entityID)
            throws CachingException
Removes the entity referred to by entityID from the cache and notifies peer caches.

Parameters:
entityID -
Throws:
CachingException

remove

public void remove(IBasicEntity ent)
            throws CachingException
Removes the IBasicEntity from the cache and notifies peer caches.

Parameters:
ent - org.jasig.portal.IBasicEntity
Throws:
CachingException

start

public static EntityCachingService start()
                                  throws CachingException
Throws:
CachingException

update

public void update(IBasicEntity ent)
            throws CachingException
Updates the entity in the cache and notifies peer caches.

Parameters:
ent - org.jasig.portal.concurrency.IBasicEntity
Throws:
CachingException

uPortal 2.4.1
API Documentation