Clover coverage report - Coverage timestamp: do jan 22 2004 21:12:32 CET FRAMES NO FRAMES |
file stats: | LOC: | 72 |  | Methods: | 5
| NCLOC: | 23 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
CacheMapAccessEvent.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.CacheEntry;
8 |  |
9 |  |
     /**
10 |  |
      * Cache map access event. This is the object created when an event occurs on a
11 |  |
      * cache map (cache Hit, cache miss). It contains the entry that was referenced
12 |  |
      * by the event and the event type.
13 |  |
      *
14 |  |
      * @version        $Revision: 1.1 $
15 |  |
      * @author <a href="mailto:fbeauregard@pyxis-tech.com">Francois Beauregard</a>
16 |  |
      */
17 |  |
     public final class CacheMapAccessEvent extends CacheEvent {
18 |  |
         /**
19 |  |
          * The cache entry that the event applies to.
20 |  |
          */
21 |  |
         private CacheEntry entry = null;
22 |  |
23 |  |
         /**
24 |  |
          * Type of the event.
25 |  |
          */
26 |  |
         private CacheMapAccessEventType eventType = null;
27 |  |
28 |  |
         /**
29 |  |
          * Constructor.
30 |  |
          * <p>
31 |  |
          * @param eventType   Type of the event.
32 |  |
          * @param entry       The cache entry that the event applies to.
33 |  |
          */
34 | 18 |
         public CacheMapAccessEvent(CacheMapAccessEventType eventType, CacheEntry entry) {
35 | 18 |
             this(eventType, entry, null);
36 |  |
         }
37 |  |
38 |  |
         /**
39 |  |
          * Constructor.
40 |  |
          * <p>
41 |  |
          * @param eventType   Type of the event.
42 |  |
          * @param entry       The cache entry that the event applies to.
43 |  |
          * @param origin      The origin of the event
44 |  |
          */
45 | 300 |
         public CacheMapAccessEvent(CacheMapAccessEventType eventType, CacheEntry entry, String origin) {
46 | 300 |
             super(origin);
47 | 300 |
             this.eventType = eventType;
48 | 300 |
             this.entry = entry;
49 |  |
         }
50 |  |
51 |  |
         /**
52 |  |
          * Retrieve the cache entry that the event applies to.
53 |  |
          */
54 | 6 |
         public CacheEntry getCacheEntry() {
55 | 6 |
             return entry;
56 |  |
         }
57 |  |
58 |  |
         /**
59 |  |
          * Retrieve the cache entry key that the event applies to.
60 |  |
          */
61 | 6 |
         public String getCacheEntryKey() {
62 | 6 |
             return entry.getKey();
63 |  |
         }
64 |  |
65 |  |
         /**
66 |  |
          * Retrieve the type of the event.
67 |  |
          */
68 | 153 |
         public CacheMapAccessEventType getEventType() {
69 | 153 |
             return eventType;
70 |  |
         }
71 |  |
     }
72 |  |