|
|||||||||||||||||||
| 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: 254 $ | |
| 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 | 30 | public CacheMapAccessEvent(CacheMapAccessEventType eventType, CacheEntry entry) { |
| 35 | 30 | 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 | 4565595 | public CacheMapAccessEvent(CacheMapAccessEventType eventType, CacheEntry entry, String origin) { |
| 46 | 4565595 | super(origin); |
| 47 | 4565595 | this.eventType = eventType; |
| 48 | 4565595 | this.entry = entry; |
| 49 | } | |
| 50 | ||
| 51 | /** | |
| 52 | * Retrieve the cache entry that the event applies to. | |
| 53 | */ | |
| 54 | 10 | public CacheEntry getCacheEntry() { |
| 55 | 10 | return entry; |
| 56 | } | |
| 57 | ||
| 58 | /** | |
| 59 | * Retrieve the cache entry key that the event applies to. | |
| 60 | */ | |
| 61 | 10 | public String getCacheEntryKey() { |
| 62 | 10 | return entry.getKey(); |
| 63 | } | |
| 64 | ||
| 65 | /** | |
| 66 | * Retrieve the type of the event. | |
| 67 | */ | |
| 68 | 377 | public CacheMapAccessEventType getEventType() { |
| 69 | 377 | return eventType; |
| 70 | } | |
| 71 | } |
|
||||||||||