org.jasig.portal.concurrency.caching
Class MapBackedEntityCache

java.lang.Object
  extended by org.jasig.portal.concurrency.caching.MapBackedEntityCache
All Implemented Interfaces:
IEntityCache

public class MapBackedEntityCache
extends Object
implements IEntityCache

Implements the uPortal caching API to wrap a Map based cache

Version:
$Revision$
Author:
Eric Dalquist

Constructor Summary
MapBackedEntityCache(Map<Serializable,IBasicEntity> cache, Class<? extends IBasicEntity> entityType)
           
 
Method Summary
 void add(IBasicEntity entity)
           
 void cleanupCache()
          Deprecated. 
 void clearCache()
          Remove all entries from the cache.
 IBasicEntity get(String key)
           
 Class<? extends IBasicEntity> getEntityType()
           
 void remove(String entityKey)
           
 int size()
          Answers the number of entries in the cache.
 void update(IBasicEntity entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapBackedEntityCache

public MapBackedEntityCache(Map<Serializable,IBasicEntity> cache,
                            Class<? extends IBasicEntity> entityType)
Method Detail

add

public void add(IBasicEntity entity)
         throws CachingException
Specified by:
add in interface IEntityCache
Parameters:
entity - - the entity to be cached.
Throws:
CachingException

clearCache

public void clearCache()
                throws CachingException
Description copied from interface: IEntityCache
Remove all entries from the cache.

Specified by:
clearCache in interface IEntityCache
Throws:
CachingException

get

public IBasicEntity get(String key)
Specified by:
get in interface IEntityCache
Parameters:
key - the key of the entity.
Returns:
org.jasig.portal.concurrency.IBasicEntity

getEntityType

public Class<? extends IBasicEntity> getEntityType()
Specified by:
getEntityType in interface IEntityCache
Returns:
java.lang.Class
See Also:
for known types.

remove

public void remove(String entityKey)
            throws CachingException
Specified by:
remove in interface IEntityCache
Parameters:
entityKey - - the key of the entity to be un-cached.
Throws:
CachingException

update

public void update(IBasicEntity entity)
            throws CachingException
Specified by:
update in interface IEntityCache
Parameters:
entity - - the entity to be updated in the cache.
Throws:
CachingException

size

public int size()
Description copied from interface: IEntityCache
Answers the number of entries in the cache. May return -1 if the cache does not make this information avaialble

Specified by:
size in interface IEntityCache

cleanupCache

@Deprecated
public void cleanupCache()
                  throws CachingException
Deprecated. 

Description copied from interface: IEntityCache
Purge stale entries from the cache.

Specified by:
cleanupCache in interface IEntityCache
Throws:
CachingException


Copyright © 2010 Jasig. All Rights Reserved.