KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > opensymphony > oscache > base > events > ScopeEvent


1 /*
2  * Copyright (c) 2002-2003 by OpenSymphony
3  * All rights reserved.
4  */

5 package com.opensymphony.oscache.base.events;
6
7 import java.util.Date JavaDoc;
8
9 /**
10  * A <code>ScopeEvent</code> is created when an event occurs across one or all scopes.
11  * This type of event is only applicable to the <code>ServletCacheAdministrator</code>.
12  *
13  * @version $Revision: 1.1 $
14  * @author <a HREF="mailto:fbeauregard@pyxis-tech.com">Francois Beauregard</a>
15  */

16 public final class ScopeEvent extends CacheEvent {
17     /**
18      * Date that the event applies to.
19      */

20     private Date JavaDoc date = null;
21
22     /**
23      * Type of the event.
24      */

25     private ScopeEventType eventType = null;
26
27     /**
28      * Scope that applies to this event.
29      */

30     private int scope = 0;
31
32     /**
33      * Constructs a scope event object with no specified origin.
34      *
35      * @param eventType Type of the event.
36      * @param scope Scope that applies to the event.
37      * @param date Date that the event applies to.
38      */

39     public ScopeEvent(ScopeEventType eventType, int scope, Date JavaDoc date) {
40         this(eventType, scope, date, null);
41     }
42
43     /**
44      * Constructs a scope event object.
45      *
46      * @param eventType Type of the event.
47      * @param scope Scope that applies to the event.
48      * @param date Date that the event applies to.
49      * @param origin The origin of this event.
50      */

51     public ScopeEvent(ScopeEventType eventType, int scope, Date JavaDoc date, String JavaDoc origin) {
52         super(origin);
53         this.eventType = eventType;
54         this.scope = scope;
55         this.date = date;
56     }
57
58     /**
59      * Retrieve the event date
60      */

61     public Date JavaDoc getDate() {
62         return date;
63     }
64
65     /**
66      * Retrieve the type of the event.
67      */

68     public ScopeEventType getEventType() {
69         return eventType;
70     }
71
72     /**
73      * Retrieve the scope that applies to the event.
74      */

75     public int getScope() {
76         return scope;
77     }
78 }
79
Popular Tags