|
|||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
CachewideEvent.java | - | 100% | 100% | 100% |
|
1 | /* | |
2 | * Copyright (c) 2002-2003 by OpenSymphony | |
3 | * All rights reserved. | |
4 | */ | |
5 | package com.opensymphony.oscache.base.events; | |
6 | ||
7 | import com.opensymphony.oscache.base.Cache; | |
8 | ||
9 | import java.util.Date; | |
10 | ||
11 | /** | |
12 | * A <code>CachewideEvent<code> represents and event that occurs on | |
13 | * the the entire cache, eg a cache flush or clear. | |
14 | * | |
15 | * @version $Revision: 254 $ | |
16 | * @author <a href="mailto:chris@swebtec.com">Chris Miller</a> | |
17 | */ | |
18 | public final class CachewideEvent extends CacheEvent { | |
19 | /** | |
20 | * The cache where the event occurred. | |
21 | */ | |
22 | private Cache cache = null; | |
23 | ||
24 | /** | |
25 | * The date/time for when the flush is scheduled | |
26 | */ | |
27 | private Date date = null; | |
28 | ||
29 | /** | |
30 | * Constructs a cachewide event with the specified origin. | |
31 | * | |
32 | * @param cache The cache map that the event occurred on. | |
33 | * @param date The date/time that this cachewide event is scheduled for | |
34 | * (eg, the date that the cache is to be flushed). | |
35 | * @param origin An optional tag that can be attached to the event to | |
36 | * specify the event's origin. This is useful to prevent events from being | |
37 | * fired recursively in some situations, such as when an event handler | |
38 | * causes another event to be fired. | |
39 | */ | |
40 | 26 | public CachewideEvent(Cache cache, Date date, String origin) { |
41 | 26 | super(origin); |
42 | 26 | this.date = date; |
43 | 26 | this.cache = cache; |
44 | } | |
45 | ||
46 | /** | |
47 | * Retrieve the cache map that the event occurred on. | |
48 | */ | |
49 | 10 | public Cache getCache() { |
50 | 10 | return cache; |
51 | } | |
52 | ||
53 | /** | |
54 | * Retrieve the date/time that the cache flush is scheduled for. | |
55 | */ | |
56 | 17 | public Date getDate() { |
57 | 17 | return date; |
58 | } | |
59 | } |
|