KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > dods > cache > CacheConstants


1 /*
2  * Enhydra Java Application Server Project
3  *
4  * The contents of this file are subject to the Enhydra Public License
5  * Version 1.1 (the "License"); you may not use this file except in
6  * compliance with the License. You may obtain a copy of the License on
7  * the Enhydra web site ( http://www.enhydra.org/ ).
8  *
9  * Software distributed under the License is distributed on an "AS IS"
10  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
11  * the License for the specific terms governing rights and limitations
12  * under the License.
13  *
14  * The Initial Developer of the Enhydra Application Server is Lutris
15  * Technologies, Inc. The Enhydra Application Server and portions created
16  * by Lutris Technologies, Inc. are Copyright Lutris Technologies, Inc.
17  * All Rights Reserved.
18  *
19  */

20 package org.enhydra.dods.cache;
21
22 /**
23  * This intefrace contains constants needed for data object (or DataStruct
24  * object), simple query and complex query caches.
25  *
26  * @author Nenad Vico
27  * @author Zorica Suvajdzin
28  * @author Tanja Jovanovic
29  * @version 2.0 15.06.2003.
30  *
31  */

32 public interface CacheConstants {
33 // 26.08.2004 tj added multi-join query cache
34
/**
35      * Methods use this constant for retrieving information about data object or
36      * DataStruct object cache.
37      */

38     public static final int DATA_CACHE = 0;
39
40     /**
41      * Methods use this constant for retrieving information about simple query
42      * cache.
43      */

44     public static final int SIMPLE_QUERY_CACHE = 1;
45
46     /**
47      * Methods use this constant for retrieving information about complex query
48      * cache.
49      */

50     public static final int COMPLEX_QUERY_CACHE = 2;
51     
52     /**
53      * Methods use this constant for retrieving information about multi-join
54      * query cache.
55      */

56     public static final int MULTI_JOIN_QUERY_CACHE = 3;
57
58     /**
59      * Only data object (or DataStruct object) cache is enabled. Simple and
60      * complex query caches are disabled.
61      */

62     public static final int DATA_CACHING = 1;
63
64     /**
65      * Beside data object (or DataStruct object) cache, which is enabled,
66      * at least one of simple and complex query caches is enabled.
67      */

68     public static final int QUERY_CACHING = 2;
69
70     /**
71      * Constant for maximal number of data objects (or DataStruct object) in
72      * the cache.
73      * Used if application's configuration file doesn't contain information
74      * about maximal cache size.
75      */

76     public static final int DEFAULT_MAX_CACHE_SIZE = 0;
77
78     /**
79      * Constant for maximal number of Query objects in the simple query cache.
80      * Used if application's configuration file doesn't contain information
81      * about maximal simple query cache size.
82      */

83     public final int DEFAULT_MAX_SIMPLE_QUERY_CACHE_SIZE = 0;
84
85     /**
86      * Constant for maximal number of Query objects in the complex query cache.
87      * Used if application's configuration file doesn't contain information
88      * about maximal complex query cache size.
89      */

90     public final int DEFAULT_MAX_COMPLEX_QUERY_CACHE_SIZE = 0;
91     
92     /**
93      * Constant for maximal number of Query objects in the multi-join query
94      * cache. Used if application's configuration file doesn't contain
95      * information about maximal multi-join query cache size.
96      */

97     public final int DEFAULT_MAX_MULTI_JOIN_QUERY_CACHE_SIZE = 0;
98
99     /**
100      * Constant used in query caching. If is percent of how many more object are
101      * taken for evaluation. If <CODE>num</CODE> is number of needed results, then
102      * it is used <code>num</code> + DEFAULT_RESERVE_FACTOR * <code>num</code> of
103      * objects for estimating what is quicker: go to database for all object that
104      * are not in the cache, or run again query on database.
105      * This value is given in percents, as number between 0 and 1
106      * (0.25 means 25%).
107      * For example, if DEFAULT_RESERVE_FACTOR is 0.0, and wanted number of
108      * results is 50, the estimation will be done on 75 (50 + 0.5 * 50) objects.
109      */

110     public final double DEFAULT_RESERVE_FACTOR = 0;
111     
112     public final boolean DEFAULT_TRANSACTION_CHECK = false;
113     
114     public final boolean DEFAULT_DELETE_CHECK_VERSION = false;
115     
116     public final boolean DEFAULT_AUTO_WRITE = false;
117     
118     public final boolean DEFAULT_TRANSACTION_CACHES = false;
119     
120     public final boolean DEFAULT_AUTO_SAVE = false;
121     
122     public final boolean DEFAULT_AUTO_SAVE_CREATE_VIRGIN = false;
123     
124     public final int DEFAULT_DEFAULT_FETCH_SIZE = -1;
125     
126     public final int DEFAULT_DEADLOCK_READ_TIME = 0;
127     
128     public final int DEFAULT_DEADLOCK_RETRY_NUMBER = 0;
129     
130     public final int DEFAULT_QUERY_TIMEOUT = 0;
131     
132     public final boolean DEFAULT_LAZY_LOADING = false;
133     
134     public final int DEFAULT_MAX_EXECUTE_TIME = 0;
135     
136     public final boolean DEFAULT_INITIAL_ALL_CACHES = false;
137     
138     public final String JavaDoc DEFAULT_INITIAL_CONDITION = null;
139     
140     public final boolean DEFAULT_All_READONLY = false;
141     
142     public final boolean DEFAULT_READONLY = false;
143     
144     public final double DEFAULT_CACHE_PERCENTAGE = -1.0;
145     
146     public final boolean DEFAULT_CASE_SENSITIVE = false;
147     
148     public final String JavaDoc DEFAULT_APP_NAME = null;
149     
150     public final int DEFAULT_INITIAL_CACHE_FETCH_SIZE = 0;
151     
152     public final int DEFAULT_INITIAL_DS_CACHE_SIZE = -1;
153     
154     /**
155      * Optional select statement - used with mass Updates and/or deletes .
156      */

157     public final boolean DEFAULT_SELECT_OIDS = false;
158     
159     /**
160      * Increment versions during mass Updates.
161      */

162     public final boolean DEFAULT_INCREMENT_VERSIONS = true;
163     public final int DEFAULT_FULL_CACHE_COUNT_LIMIT = -1;
164
165     /**
166      * Names of parameters in configuration file (DatabaseManager section)
167      */

168     public final String JavaDoc PARAMNAME_TRANSACTION_CHECK = "TransactionCheck";
169     
170     public final String JavaDoc PARAMNAME_DELETE_CHECK_VERSION = "DeleteCheckVersion";
171     
172     public final String JavaDoc PARAMNAME_AUTO_WRITE = "AutoWrite";
173     
174     public final String JavaDoc PARAMNAME_TRANSACTION_CACHES = "TransactionCaches";
175     
176     public final String JavaDoc PARAMNAME_AUTO_SAVE = "AutoSave";
177     
178     public final String JavaDoc PARAMNAME_AUTO_SAVE_CREATE_VIRGIN = "AutoSaveCreateVirgin";
179     
180     public final String JavaDoc PARAMNAME_DEFAULT_FETCH_SIZE = "DefaultFetchSize";
181     
182     public final String JavaDoc PARAMNAME_DEADLOCK_READ_TIME = "CacheLockTimeout";
183     
184     public final String JavaDoc PARAMNAME_DEADLOCK_RETRY_NUMBER = "CacheLockRetryCount";
185     
186     public final String JavaDoc PARAMNAME_QUERY_TIMEOUT = "QueryTimeout";
187     
188     public final String JavaDoc PARAMNAME_ALL_READ_ONLY = "AllReadOnly";
189     
190     public static final String JavaDoc PARAMNAME_LAZY_LOADING = "lazyLoading";
191     
192     public final String JavaDoc PARAMNAME_MAX_EXECUTE_TIME = "maxExecuteTime";
193     
194     public final String JavaDoc PARAMNAME_MAX_CACHE_SIZE = "maxCacheSize";
195     
196     public final String JavaDoc PARAMNAME_MAX_SIMPLE_CACHE_SIZE = "maxSimpleCacheSize";
197     
198     public final String JavaDoc PARAMNAME_MAX_COMPLEX_CACHE_SIZE = "maxComplexCacheSize";
199     
200     public final String JavaDoc PARAMNAME_MAX_MULTI_JOIN_CACHE_SIZE = "maxMultiJoinCacheSize";
201     
202     public final String JavaDoc PARAMNAME_RESERVE_FACTOR = "reserveFactor";
203     
204     public final String JavaDoc PARAMNAME_INITIAL_ALL_CACHES = "initAllCaches";
205     
206     public final String JavaDoc PARAMNAME_INITIAL_CONDITION = "initialCondition";
207     
208     public final String JavaDoc PARAMNAME_READ_ONLY = "readOnly";
209     
210     public final String JavaDoc PARAMNAME_CACHE_PERCENTAGE = "CachePercentage";
211     
212     public final String JavaDoc PARAMNAME_CASE_SENSITIVE = "CaseSensitive";
213     
214     public final String JavaDoc PARAMNAME_APP_NAME = "AppName";
215     
216     public final String JavaDoc PARAMNAME_INITIAL_CACHE_FETCH_SIZE = "InitialCacheFetchSize";
217     
218     public final String JavaDoc PARAMNAME_INITIAL_DS_CACHE_SIZE = "InitialDSCacheSize";
219     
220     /**
221      * Name of optional select statement parameter - used with mass Updates and/or deletes.
222      */

223     public final String JavaDoc PARAMNAME_SELECT_OIDS = "SelectOids";
224     
225     /**
226      * Increment versions during mass Updates.
227      */

228     public final String JavaDoc PARAMNAME_INCREMENT_VERSIONS = "IncrementVersions";
229     public final String JavaDoc FULL_CACHE_COUNT_LIMIT = "FullCacheCountLimit";
230
231     
232     public final String JavaDoc PARAMNAME_DODS_CACHE_FACTORY="DODSCacheFactory";
233     public final String JavaDoc DEFAULT_DODS_CACHE_FACTORY="org.enhydra.dods.cache.lru.DODSLRUCacheFactory";
234 }
235
236
Popular Tags