Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jasig.portal.services
Class EntityCachingService

    java.lang.Object
      org.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.11 $
Author:
  Dan Ellentuck

Field Summary
`private IEntityCachingService` | `cache`
`private static EntityCachingService` | `instance`
`private static org.apache.commons.logging.Log` | `log`

Constructor Summary
`private` | `EntityCachingService()` Creates new EntityLockService

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.
`private void` | `initialize()`
`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
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### log

    private static final org.apache.commons.logging.Log log

### instance

    private static EntityCachingService instance

### cache

    private IEntityCachingService cache

Constructor Detail

### EntityCachingService

    private EntityCachingService()
                          throws CachingException

  Creates new EntityLockService

  Throws:
    `CachingException`

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`

### initialize

    private void initialize()
                     throws CachingException

  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`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD