01: /* Copyright 2002 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:
06: package org.jasig.portal.concurrency;
07:
08: import org.jasig.portal.IBasicEntity;
09:
10: /**
11: * Defines an api for a caching service that caches and retrieves
12: * <code>IBasicEntities</code>. Cached entities of a given type are
13: * stored in an <code>IEntityCache</code>. The service manages
14: * access to these caches and is respon sible for initiating any
15: * cache clean up or invalidation.
16: * <p>
17: * The actual caching api is minimal:
18: * <p>
19: * <code>
20: * void add(IBasicEntity entity);<br>
21: * IBasicEntity get(Class type, String key);<br>
22: * void remove(Class type, String key);<br>
23: * void update(IBasicEntity entity);<br>
24: * </code>
25: * <p>
26: *
27: * @author Dan Ellentuck
28: * @version $Revision: 34757 $
29: *
30: * @see org.jasig.portal.IBasicEntity
31: * @see org.jasig.portal.concurrency.IEntityCache
32: *
33: */
34: public interface IEntityCachingService {
35:
36: /**
37: * Adds the entity to the cache.
38: * @param ent org.jasig.portal.concurrency.IBasicEntity
39: * @exception org.jasig.portal.concurrency.CachingException
40: */
41: public void add(IBasicEntity ent) throws CachingException;
42:
43: /**
44: * Returns the cached entity identified by type and key.
45: * @param type Class
46: * @param key String
47: * @return IBasicEntity entity
48: * @exception org.jasig.portal.concurrency.CachingException
49: */
50: public IBasicEntity get(Class type, String key)
51: throws CachingException;
52:
53: /**
54: * Removes the cached entity identified by type and key from the cache
55: * and notifies peer caches.
56: * @param type Class
57: * @param key String
58: * @exception CachingException
59: */
60: public void remove(Class type, String key) throws CachingException;
61:
62: /**
63: * Updates the entity in the cache and notifies peer caches.
64: * @param ent org.jasig.portal.concurrency.IBasicEntity
65: * @exception org.jasig.portal.concurrency.CachingException
66: */
67: public void update(IBasicEntity ent) throws CachingException;
68: }
|