1 package org.apache.jcs.engine.control.event;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.EventObject;
23
24 import org.apache.jcs.engine.control.event.behavior.IElementEvent;
25 import org.apache.jcs.engine.control.event.behavior.IElementEventConstants;
26
27 /***
28 * Element events will trigger the creation of Element Event objects. This is a
29 * wrapper around the cache element that indicates the event triggered.
30 *
31 */
32 public class ElementEvent
33 extends EventObject
34 implements IElementEventConstants, IElementEvent
35 {
36
37 private static final long serialVersionUID = -5364117411457467056L;
38
39 private int elementEvent = ElementEvent.ELEMENT_EVENT_EXCEEDED_MAXLIFE_BACKGROUND;
40
41 /***
42 * Constructor for the ElementEvent object
43 *
44 * @param source
45 * The Cache Element (should restrict?)
46 * @param elementEvent
47 * The event id defined in the constants class.
48 */
49 public ElementEvent( Object source, int elementEvent )
50 {
51 super( source );
52 this.elementEvent = elementEvent;
53 }
54
55 /***
56 * Gets the elementEvent attribute of the ElementEvent object
57 *
58 * @return The elementEvent value. The List of values is defined in
59 * IElementEventConstants.
60 */
61 public int getElementEvent()
62 {
63 return elementEvent;
64 }
65
66 }