org.jasig.portal.services
Class EntityCachingService

java.lang.Object
  extended by org.jasig.portal.services.EntityCachingService
All Implemented Interfaces:
IEntityCachingService

Deprecated. Where possible the Spring managed IEntityCachingService bean should be injected instead of using this lookup class.

@Deprecated
public class EntityCachingService
extends Object
implements IEntityCachingService

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: 19776 $
Author:
Dan Ellentuck

Method Summary
 void add(IBasicEntity ent)
          Deprecated. Adds the entity to the cache.
 IBasicEntity get(Class<? extends IBasicEntity> type, String key)
          Deprecated. Returns the cached entity identified by type and key.
 IBasicEntity get(EntityIdentifier entityID)
          Deprecated. Returns the cached entity referred to by entityID.
static IEntityCachingService getEntityCachingService()
          Deprecated.  
static EntityCachingService instance()
          Deprecated. Use getEntityCachingService() instead.
 void remove(Class<? extends IBasicEntity> type, String key)
          Deprecated. Removes the entity identified by type and key from the cache and notifies peer caches.
 void remove(EntityIdentifier entityID)
          Deprecated. Removes the entity referred to by entityID from the cache and notifies peer caches.
 void remove(IBasicEntity ent)
          Deprecated. Removes the IBasicEntity from the cache and notifies peer caches.
 void update(IBasicEntity ent)
          Deprecated. 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
 

Method Detail

instance

@Deprecated
public static EntityCachingService instance()
                                     throws CachingException
Deprecated. Use getEntityCachingService() instead.

Throws:
CachingException

getEntityCachingService

public static IEntityCachingService getEntityCachingService()
Deprecated. 

add

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

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

get

public IBasicEntity get(Class<? extends IBasicEntity> type,
                        String key)
                 throws CachingException
Deprecated. 
Returns the cached entity identified by type and key.

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

get

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

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

remove

public void remove(Class<? extends IBasicEntity> type,
                   String key)
            throws CachingException
Deprecated. 
Removes the entity identified by type and key from the cache and notifies peer caches.

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

remove

public void remove(EntityIdentifier entityID)
            throws CachingException
Deprecated. 
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
Deprecated. 
Removes the IBasicEntity from the cache and notifies peer caches.

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

update

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

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


Copyright © 2010 Jasig. All Rights Reserved.