01: /*
02: Copyright 2004 Philip Jacob <phil@whirlycott.com>
03: Seth Fitzsimmons <seth@note.amherst.edu>
04:
05: Licensed under the Apache License, Version 2.0 (the "License");
06: you may not use this file except in compliance with the License.
07: You may obtain a copy of the License at
08:
09: http://www.apache.org/licenses/LICENSE-2.0
10:
11: Unless required by applicable law or agreed to in writing, software
12: distributed under the License is distributed on an "AS IS" BASIS,
13: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: See the License for the specific language governing permissions and
15: limitations under the License.
16: */
17:
18: package com.whirlycott.cache;
19:
20: /**
21: * Serves to encapsulate several constant values.
22: *
23: * @author Philip Jacob
24: */
25: public class Constants {
26:
27: /**
28: * Name of a node in the XML configuration file.
29: */
30: public static final String CONFIG_CACHE = "cache"; //$NON-NLS-1$
31:
32: /**
33: * Name of an attribute in the XML configuration file.
34: */
35: public static final String CONFIG_NAME = "name"; //$NON-NLS-1$
36:
37: /**
38: * Name of a node in the XML configuration file.
39: */
40: public static final String CONFIG_BACKEND = "backend"; //$NON-NLS-1$
41:
42: /**
43: * Name of a node in the XML configuration file.
44: */
45: public static final String CONFIG_MAXSIZE = "maxsize"; //$NON-NLS-1$
46:
47: /**
48: * The user-supplied configuration file.
49: */
50: public static final String CONFIG_FILE = "/whirlycache.xml"; //$NON-NLS-1$
51:
52: /**
53: * Name of a node in the XML configuration file.
54: */
55: public static final String CONFIG_TUNER_SLEEPTIME = "tuner-sleeptime"; //$NON-NLS-1$
56:
57: /**
58: * Name of a node in the XML configuration file.
59: */
60: public static final String CONFIG_TUNER_THREADS = "tuner-threads"; //$NON-NLS-1$
61:
62: /**
63: * Name of a node in the XML configuration file.
64: */
65: public static final String CONFIG_POLICY = "policy"; //$NON-NLS-1$
66:
67: /**
68: * The backup configuration file (only used in case whirlycache.xml is not found.
69: */
70: public static final String DEFAULT_CONFIG_FILE = "/whirlycache-default.xml"; //$NON-NLS-1$
71:
72: /**
73: * If statistics collection is enabled at build time, this is set to true. This
74: * can provide some optimizations for those of you who don't care to collect data
75: * about how fast the cache is processing requests.
76: */
77: public static final boolean BUILD_STATS_ENABLED = true;
78:
79: /**
80: * If Item expiration is enabled at build time, this is set to true. This allows
81: * expiration times to be set for individual items. Turning this off will speed up
82: * the tuner thread slightly.
83: */
84: public static final boolean ITEM_EXPIRATION_ENABLED = true;
85: }
|