View Javadoc

1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    * 
9    *      http://www.apache.org/licenses/LICENSE-2.0
10   * 
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  package org.apache.jetspeed.cache;
18  
19  /***
20   * <p>
21   * Provides interface to Jetspeed for cache events
22   * </p>
23   * 
24   * @author <a href="mailto:taylor@apache.org">David Sean Taylor</a>
25   * @version $Id: $
26   */
27  public interface JetspeedCacheEventListener
28  {
29  
30  	/***
31  	 * REMOVE notification for cache listeners
32  	 * 
33  	 * @param cache
34  	 *            the Cache repoorting the change
35  	 * @param local
36  	 *            true if action was local, false if initiated by remote cache
37  	 * @param key
38  	 *            key of object
39  	 * @param element
40  	 *            content of object
41  	 * 
42  	 */
43  	void notifyElementRemoved(JetspeedCache cache, boolean local, Object key,
44  			Object element);
45  
46  	/***
47  	 * ADDED notification for cache listeners
48  	 * 
49  	 * @param cache
50  	 *            the Cache repoorting the change
51  	 * @param local
52  	 *            true if action was local, false if initiated by remote cache
53  	 * @param key
54  	 *            key of object
55  	 * @param element
56  	 *            content of object
57  	 * 
58  	 */
59  	void notifyElementAdded(JetspeedCache cache, boolean local, Object key,
60  			Object element);
61  
62  	/***
63  	 * CHANGE notification for cache listeners
64  	 * 
65  	 * @param cache
66  	 *            the Cache repoorting the change
67  	 * @param local
68  	 *            true if action was local, false if initiated by remote cache
69  	 * @param key
70  	 *            key of object
71  	 * @param element
72  	 *            content of object
73  	 * 
74  	 */
75  	void notifyElementChanged(JetspeedCache cache, boolean local, Object key,
76  			Object element);
77  
78  	/***
79  	 * EVICTED notification for cache listeners
80  	 * 
81  	 * @param cache
82  	 *            the Cache repoorting the change
83  	 * @param local
84  	 *            true if action was local, false if initiated by remote cache
85  	 * @param key
86  	 *            key of object
87  	 * @param element
88  	 *            content of object
89  	 * 
90  	 */
91  	void notifyElementEvicted(JetspeedCache cache, boolean local, Object key,
92  			Object element);
93  
94  	/***
95  	 * EXPIRED notification for cache listeners
96  	 * 
97  	 * @param cache
98  	 *            the Cache repoorting the change
99  	 * @param local
100 	 *            true if action was local, false if initiated by remote cache
101 	 * @param key
102 	 *            key of object
103 	 * @param element
104 	 *            content of object
105 	 * 
106 	 */
107 	void notifyElementExpired(JetspeedCache cache, boolean local, Object key,
108 			Object element);
109 
110 }