com.arsdigita.kernel
Class ACSObjectCache

java.lang.Object
  extended bycom.arsdigita.kernel.ACSObjectCache

public class ACSObjectCache
extends Object

A centralized cache for ACSObjects. At present, it only supports caching of objects in the request. Evenutally, it should support caching objects as request, session and request attributes.

For request-scope caching, objects are stored as attributes of the ServletRequest. The name of the attribute only depends on the object's ID, so that only one copy of each object is stored.

Version:
$Id: //core-platform/dev/src/com/arsdigita/kernel/ACSObjectCache.java#9 $
Author:
David Lutterkort

Method Summary
static ACSObject get(javax.servlet.ServletRequest req, BigDecimal id)
          Get the ACSObject with ID id from the request req.
static void set(javax.servlet.ServletRequest req, ACSObject obj)
          Store obj as a request attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

set

public static void set(javax.servlet.ServletRequest req,
                       ACSObject obj)
Store obj as a request attribute.

Parameters:
req - the request, in which the object is to be cached.
obj - the object to cache.

get

public static ACSObject get(javax.servlet.ServletRequest req,
                            BigDecimal id)
Get the ACSObject with ID id from the request req. Return null if the object has not been put into the cache. If the ID is null then this will return null.

Parameters:
req - the request, in which the object is to be cached.
id - an Object value
Returns:
an ACSObject value or null if the id is null


Copyright (c) 2004 Red Hat, Inc. Corporation. All Rights Reserved. Generated at July 21 2004:2337 UTC