01: /**********************************************************************
02: Copyright (c) 2005 Erik Bengtson and others. All rights reserved.
03: Licensed under the Apache License, Version 2.0 (the "License");
04: you may not use this file except in compliance with the License.
05: You may obtain a copy of the License at
06:
07: http://www.apache.org/licenses/LICENSE-2.0
08:
09: Unless required by applicable law or agreed to in writing, software
10: distributed under the License is distributed on an "AS IS" BASIS,
11: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12: See the License for the specific language governing permissions and
13: limitations under the License.
14:
15:
16: Contributors:
17: ...
18: **********************************************************************/package org.jpox.cache;
19:
20: import java.util.HashMap;
21: import java.util.Properties;
22:
23: import org.jpox.util.SoftValueMap;
24:
25: /**
26: * Soft implementation of a Level 2 cache for JPOX.
27: * The second (unpinned) map stores soft references meaning that they may be garbage
28: * collected only if necessary by the JVM.
29: * <P>
30: *
31: * @version $Revision: 1.2 $
32: */
33: public class SoftLevel2Cache extends DefaultLevel2Cache {
34: /**
35: * Constructor.
36: * @param props Any properties to control the cache
37: */
38: public SoftLevel2Cache(Properties props) {
39: pinnedCache = new HashMap();
40:
41: unpinnedCache = new SoftValueMap();
42: }
43:
44: }
|