1 package org.apache.jcs.engine.behavior;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.io.IOException;
23
24 /***
25 * Used to register interest in receiving cache changes. <br>
26 * <br>
27 * Note: server which implements this interface provides a local cache event
28 * notification service, whereas server which implements IRmiCacheWatch provides
29 * a remote cache event notification service.
30 *
31 */
32 public interface ICacheObserver
33 {
34 /***
35 * Subscribes to the specified cache.
36 *
37 * @param cacheName
38 * the specified cache.
39 * @param obj
40 * object to notify for cache changes.
41 * @throws IOException
42 */
43 public void addCacheListener( String cacheName, ICacheListener obj )
44 throws IOException;
45
46
47
48 /***
49 * Subscribes to all caches.
50 *
51 * @param obj
52 * object to notify for all cache changes.
53 * @throws IOException
54 */
55 public void addCacheListener( ICacheListener obj )
56 throws IOException;
57
58 /***
59 * Unsubscribes from the specified cache.
60 * @param cacheName
61 *
62 * @param obj
63 * existing subscriber.
64 * @throws IOException
65 */
66 public void removeCacheListener( String cacheName, ICacheListener obj )
67 throws IOException;
68
69 /***
70 * Unsubscribes from all caches.
71 *
72 * @param obj
73 * existing subscriber.
74 * @throws IOException
75 */
76 public void removeCacheListener( ICacheListener obj )
77 throws IOException;
78 }