01: /**********************************************************************************
02: * $URL: https://source.sakaiproject.org/svn/memory/tags/sakai_2-4-1/memory-impl/impl/src/java/org/sakaiproject/memory/impl/HardCache.java $
03: * $Id: HardCache.java 7103 2006-03-28 04:01:50Z ggolden@umich.edu $
04: ***********************************************************************************
05: *
06: * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.
07: *
08: * Licensed under the Educational Community License, Version 1.0 (the "License");
09: * you may not use this file except in compliance with the License.
10: * You may obtain a copy of the License at
11: *
12: * http://www.opensource.org/licenses/ecl1.php
13: *
14: * Unless required by applicable law or agreed to in writing, software
15: * distributed under the License is distributed on an "AS IS" BASIS,
16: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17: * See the License for the specific language governing permissions and
18: * limitations under the License.
19: *
20: **********************************************************************************/package org.sakaiproject.memory.impl;
21:
22: import org.sakaiproject.event.api.EventTrackingService;
23: import org.sakaiproject.memory.api.CacheRefresher;
24:
25: /**
26: * <p>
27: * HardCache is a MemCache set to use hard, not soft references.
28: * </p>
29: */
30: public class HardCache extends MemCache {
31: /**
32: * Construct the Cache. No automatic refresh handling.
33: */
34: public HardCache(BasicMemoryService memoryService,
35: EventTrackingService eventTrackingService) {
36: super (memoryService, eventTrackingService);
37: m_softRefs = false;
38: }
39:
40: /**
41: * Construct the Cache. Attempts to keep complete on Event notification by calling the refresher.
42: *
43: * @param refresher
44: * The object that will handle refreshing of event notified modified or added entries.
45: * @param pattern
46: * The "startsWith()" string for all resources that may be in this cache - if null, don't watch events for updates.
47: */
48: public HardCache(BasicMemoryService memoryService,
49: EventTrackingService eventTrackingService,
50: CacheRefresher refresher, String pattern) {
51: super (memoryService, eventTrackingService, refresher, pattern);
52: m_softRefs = false;
53: }
54:
55: /**
56: * Construct the Cache. Automatic refresh handling if refresher is not null.
57: *
58: * @param refresher
59: * The object that will handle refreshing of expired entries.
60: * @param sleep
61: * The number of seconds to sleep between expiration checks.
62: */
63: public HardCache(BasicMemoryService memoryService,
64: EventTrackingService eventTrackingService,
65: CacheRefresher refresher, long sleep) {
66: super (memoryService, eventTrackingService, refresher, sleep);
67: m_softRefs = false;
68: }
69:
70: /**
71: * Construct the Cache. No automatic refresh: expire only, from time and events.
72: *
73: * @param sleep
74: * The number of seconds to sleep between expiration checks.
75: * @param pattern
76: * The "startsWith()" string for all resources that may be in this cache - if null, don't watch events for updates.
77: */
78: public HardCache(BasicMemoryService memoryService,
79: EventTrackingService eventTrackingService, long sleep,
80: String pattern) {
81: super (memoryService, eventTrackingService, sleep, pattern);
82: m_softRefs = false;
83: }
84: }
|