KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > whirlycott > cache > Constants


1 /*
2 Copyright 2004 Philip Jacob <phil@whirlycott.com>
3                     Seth Fitzsimmons <seth@note.amherst.edu>
4
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
8
9     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 JavaDoc CONFIG_CACHE = "cache"; //$NON-NLS-1$
31

32     /**
33      * Name of an attribute in the XML configuration file.
34      */

35     public static final String JavaDoc CONFIG_NAME = "name"; //$NON-NLS-1$
36

37     /**
38      * Name of a node in the XML configuration file.
39      */

40     public static final String JavaDoc CONFIG_BACKEND = "backend"; //$NON-NLS-1$
41

42     /**
43      * Name of a node in the XML configuration file.
44      */

45     public static final String JavaDoc CONFIG_MAXSIZE = "maxsize"; //$NON-NLS-1$
46

47     /**
48      * The user-supplied configuration file.
49      */

50     public static final String JavaDoc 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 JavaDoc 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 JavaDoc CONFIG_POLICY = "policy"; //$NON-NLS-1$
61

62     /**
63      * The backup configuration file (only used in case whirlycache.xml is not found.
64      */

65     public static final String JavaDoc DEFAULT_CONFIG_FILE = "/whirlycache-default.xml"; //$NON-NLS-1$
66

67     /**
68      * If statistics collection is enabled at build time, this is set to true. This
69      * can provide some optimizations for those of you who don't care to collect data
70      * about how fast the cache is processing requests.
71      */

72     public static final boolean BUILD_STATS_ENABLED = true;
73     
74     /**
75      * If Item expiration is enabled at build time, this is set to true. This allows
76      * expiration times to be set for individual items. Turning this off will speed up
77      * the tuner thread slightly.
78      */

79     public static final boolean ITEM_EXPIRATION_ENABLED = true;
80 }
81
Popular Tags