1 package com.atlassian.cache;
2
3 import javax.annotation.Nonnull;
4
5 import com.atlassian.annotations.PublicApi;
6
7 /**
8 * A resettable reference listener.
9 *
10 * @since 2.4
11 */
12 @PublicApi
13 public interface CachedReferenceListener<V>
14 {
15 /**
16 * Invoked when the cached reference was evicted
17 *
18 * @param event the eviction event
19 */
20 void onEvict(@Nonnull CachedReferenceEvent<V> event);
21
22 /**
23 * Invoked when the cached reference was set, e.g. received a new value
24 *
25 * @param event the set event
26 */
27 void onSet(@Nonnull CachedReferenceEvent<V> event);
28
29 /**
30 * Invoked when the cached reference was reset
31 *
32 * @param event the reset event
33 */
34 void onReset(@Nonnull CachedReferenceEvent<V> event);
35 }