01: /* Copyright 2004 The JA-SIG Collaborative. All rights reserved.
02: * See license distributed with this file and
03: * available online at http://www.uportal.org/license.html
04: */
05: package org.jasig.portal.utils.cache;
06:
07: import java.util.Map;
08:
09: /**
10: * Interface for a cache factory that returns a cache that externally acts like a map.
11: * Underlying caches don't have to be a map, but they must be wrapped in the map interface
12: * if they do not.
13: *
14: * @author Scott Battaglia
15: * @version $Revision: 36682 $ $Date: 2006-08-23 12:56:56 -0700 (Wed, 23 Aug 2006) $
16: *
17: */
18: public interface CacheFactory {
19:
20: /** The cache to be used to hold user information. */
21: String USER_INFO_CACHE = "userInfoCache";
22:
23: /** The cache to be used to hold principals. */
24: String PRINCIPAL_CACHE = "principalCache";
25:
26: /** Generic default cache that can be used for anything */
27: String DEFAULT = "default";
28:
29: /**
30: * Method to retrieve a cache by name.
31: *
32: * @param cacheName the name of the cache to retrieve.
33: * @return the cache that is referenced by the cache name provided.
34: * @throws IllegalArgumentException if a cache by that name cannot be retrieved.
35: */
36: Map getCache(String cacheName) throws IllegalArgumentException;
37:
38: /**
39: * Method to retrieve a default cache without a name.
40: * @return the default cache for this CacheFactory
41: */
42: Map getCache();
43: }
|