org.jasig.portal.concurrency.caching
Class AbstractEntityCachingService

java.lang.Object
  extended by org.jasig.portal.concurrency.caching.AbstractEntityCachingService
All Implemented Interfaces:
IEntityCachingService
Direct Known Subclasses:
CacheFactoryEntityCachingService

public abstract class AbstractEntityCachingService
extends Object
implements IEntityCachingService

Provides common IEntityCachingService logic

Version:
$Revision$
Author:
Eric Dalquist

Constructor Summary
AbstractEntityCachingService()
           
 
Method Summary
 void add(IBasicEntity entity)
          Adds the entity to the cache.
 IBasicEntity get(Class<? extends IBasicEntity> entityType, String key)
          Returns the cached entity identified by type and key.
protected abstract  IEntityCache getCache(Class<? extends IBasicEntity> entityType)
          Retrieves the IEntityCache to store the specified entityType in.
 void remove(Class<? extends IBasicEntity> entityType, String key)
          Removes the cached entity identified by type and key from the cache and notifies peer caches.
 void update(IBasicEntity entity)
          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
 

Constructor Detail

AbstractEntityCachingService

public AbstractEntityCachingService()
Method Detail

getCache

protected abstract IEntityCache getCache(Class<? extends IBasicEntity> entityType)
                                  throws CachingException
Retrieves the IEntityCache to store the specified entityType in.

Parameters:
entityType - The type to retrieve the cache for
Returns:
The cache for the specified type, should never be null.
Throws:
CachingException - If no cache can be found/created for the specified entityType.
IllegalArgumentException - If entityType is null.

add

public void add(IBasicEntity entity)
         throws CachingException
Description copied from interface: IEntityCachingService
Adds the entity to the cache.

Specified by:
add in interface IEntityCachingService
Parameters:
entity - org.jasig.portal.concurrency.IBasicEntity
Throws:
CachingException

get

public IBasicEntity get(Class<? extends IBasicEntity> entityType,
                        String key)
                 throws CachingException
Description copied from interface: IEntityCachingService
Returns the cached entity identified by type and key.

Specified by:
get in interface IEntityCachingService
Parameters:
entityType - Class
key - String
Returns:
IBasicEntity entity
Throws:
CachingException

remove

public void remove(Class<? extends IBasicEntity> entityType,
                   String key)
            throws CachingException
Description copied from interface: IEntityCachingService
Removes the cached entity identified by type and key from the cache and notifies peer caches.

Specified by:
remove in interface IEntityCachingService
Parameters:
entityType - Class
key - String
Throws:
CachingException

update

public void update(IBasicEntity entity)
            throws CachingException
Description copied from interface: IEntityCachingService
Updates the entity in the cache and notifies peer caches.

Specified by:
update in interface IEntityCachingService
Parameters:
entity - org.jasig.portal.concurrency.IBasicEntity
Throws:
CachingException


Copyright © 2010 Jasig. All Rights Reserved.