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 import java.io.Serializable;
24
25 /***
26 * Used to receive a cache event notification. <br>
27 * <br>
28 * Note: objects which implement this interface are local listeners to cache
29 * changes, whereas objects which implement IRmiCacheListener are remote
30 * listeners to cache changes.
31 *
32 */
33 public interface ICacheListener
34 {
35 /*** Notifies the subscribers for a cache entry update.
36 * @param item
37 * @throws IOException*/
38 public void handlePut( ICacheElement item )
39 throws IOException;
40
41 /*** Notifies the subscribers for a cache entry removal.
42 * @param cacheName
43 * @param key
44 * @throws IOException*/
45 public void handleRemove( String cacheName, Serializable key )
46 throws IOException;
47
48 /*** Notifies the subscribers for a cache remove-all.
49 * @param cacheName
50 * @throws IOException*/
51 public void handleRemoveAll( String cacheName )
52 throws IOException;
53
54 /*** Notifies the subscribers for freeing up the named cache.
55 * @param cacheName
56 * @throws IOException*/
57 public void handleDispose( String cacheName )
58 throws IOException;
59
60 /***
61 * Notifies the subscribers for releasing all caches.
62 *
63 * @param id
64 * The new listenerId value
65 */
66
67 /***
68 * sets unique identifier of listener home
69 *
70 * @param id
71 * The new listenerId value
72 * @throws IOException
73 */
74 public void setListenerId( long id )
75 throws IOException;
76
77 /***
78 * Gets the listenerId attribute of the ICacheListener object
79 *
80 * @return The listenerId value
81 * @throws IOException
82 */
83 public long getListenerId()
84 throws IOException;
85
86 }