KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > speedo > api > SpeedoProperties


1 /**
2  * Speedo: an implementation of JDO compliant personality on top of JORM generic
3  * I/O sub-system.
4  * Copyright (C) 2001-2004 France Telecom R&D
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  *
21  *
22  * Contact: speedo@objectweb.org
23  *
24  * Authors: S.Chassande-Barrioz.
25  *
26  */

27  package org.objectweb.speedo.api;
28
29 import java.util.List JavaDoc;
30 import java.util.Arrays JavaDoc;
31 import java.util.Collections JavaDoc;
32
33 /**
34  * Defines the Speedo options which can be passed as properties to the
35  * PersistenceManagerFactory
36  */

37 public interface SpeedoProperties {
38     
39     String JavaDoc SPEEDO = "org.objectweb.speedo";
40     
41     String JavaDoc LOGGER_NAME = SPEEDO;
42
43     String JavaDoc DEBUG = SPEEDO + ".debug";
44
45     // Constant usable in the Properties of a PersistenceManagerFactory
46

47     /**
48      * Is the property value to pass to the PersistenceManagerFactory to
49      * indicate that the size is unlimited.
50      */

51     String JavaDoc NO_LIMIT = "nolimit";
52
53     /**
54      * Is the property to pass to the PersistenceManagerFactory to assign the
55      * cache size.
56      */

57     String JavaDoc CACHE_SIZE = SPEEDO + ".cache.size";
58
59     String JavaDoc CACHE_AUTO_CLEAN_SIZE = SPEEDO + ".cache.autoCleanSize";
60     String JavaDoc CACHE_AUTO_CLEAN_THRESHOLD = SPEEDO + ".cache.autoCleanThreshold";
61
62     String JavaDoc CACHE_REPLCAEMENT = SPEEDO + ".cache.policy";
63     String JavaDoc CACHE_REPLCAEMENT_FIFO = "FIFO";
64     String JavaDoc CACHE_REPLCAEMENT_LRU = "LRU";
65     String JavaDoc CACHE_REPLCAEMENT_MRU = "MRU";
66
67     String JavaDoc CACHE_CLASS_POLICY = SPEEDO + ".cache.classPolicy";
68     String JavaDoc CACHE_CLASS_POLICY_NOCACHE = "nocache";
69     String JavaDoc CACHE_CLASS_POLICY_CACHED = "cache";
70     String JavaDoc CACHE_CLASS_POLICY_FIXED = "fixed";
71     String JavaDoc CACHE_CLASS_POLICY_ALL = "all";
72     
73     String JavaDoc USER_CACHE = "user-cache";
74     String JavaDoc USER_CACHE_CLASS_POLICY = SPEEDO + ".user-cache.classPolicy";
75     
76     /**
77      * Is the property to pass to the PersistenceManagerFactory to indicate
78      * if the transactionnal environnement is managed.
79      */

80     String JavaDoc MANAGED = "org.objectweb.perseus.connector.ra.jdo.managed";
81
82     String JavaDoc TM_NAME = SPEEDO + ".jca.TMName";
83     /**
84      * @deprecated use TM_NAME
85      */

86     String JavaDoc TM_NAME_old = "org.objectweb.perseus.connector.ra.jdo.TMName";
87     /**
88      * Is the property to pass to the PersistenceManagerFactory to assign the
89      * maximum size of PersistenceManager pool.
90      */

91     String JavaDoc PM_POOL_MIN = SPEEDO + ".persistencemanager.pool.min";
92
93     /**
94      * Is the property to pass to the PersistenceManagerFactory to assign the
95      * minimum size of PersistenceManager pool.
96      */

97     String JavaDoc PM_POOL_MAX = SPEEDO + ".persistencemanager.pool.max";
98     String JavaDoc PM_POOL_TTL = SPEEDO + ".persistencemanager.pool.ttl";
99     String JavaDoc PM_POOL_INACTIVETTL = SPEEDO + ".persistencemanager.pool.inactivettl";
100     String JavaDoc PM_POOL_TIMEOUT = SPEEDO + ".persistencemanager.pool.timeout";
101
102     /**
103      * Is the property to pass to the PersistenceManagerFactory to assign the
104      * minimum size of compiled query pool.
105      */

106     String JavaDoc COMPILED_QUERY_CACHE_SIZE = SPEEDO + ".compiledquery.cache.size";
107     String JavaDoc COMPILED_QUERY_CACHE_AUTO_CLEAN_SIZE = SPEEDO + ".compiledquery.cache.autoCleanSize";
108     String JavaDoc COMPILED_QUERY_CACHE_AUTO_CLEAN_THRESHOLD = SPEEDO + ".compiledquery.cache.autoCleanThreshold";
109     String JavaDoc COMPILED_QUERY_CACHE_POLICY = SPEEDO + ".compiledquery.cache.policy";
110
111     /**
112      * Is the property to pass to the PersistenceManagerFactory to specify if
113      * the query must prefetch the data. The default value is true.
114      */

115     String JavaDoc PREFETCH = SPEEDO + ".query.prefetch";
116     String JavaDoc PREFETCH_ON_QUERY = SPEEDO + ".query.prefetch.query";
117     String JavaDoc PREFETCH_ON_EXTENT = SPEEDO + ".query.prefetch.extent";
118     String JavaDoc PREFETCH_ON_GENCLASS = SPEEDO + ".genclass.prefetch";
119
120     /**
121      * Is the property to pass to the PersistenceManagerFactory to specify the
122      * mapping structure management:
123      * - DO_NOTHING
124      * - CREATE_IF_REQUIRED
125      * - FORCE_CREATE
126      */

127     String JavaDoc MAPPING_STRUCTURE = SPEEDO + ".mappingStructure";
128     String JavaDoc MAPPING_STRUCTURE_DN = "DO_NOTHING";
129     String JavaDoc MAPPING_STRUCTURE_CIR = "CREATE_IF_REQUIRED";
130     String JavaDoc MAPPING_STRUCTURE_FC = "FORCE_CREATE";
131     String JavaDoc MAPPING_STRUCTURE_DD = "DELETE_DATA";
132
133     /**
134      * Is the property to pass to the PersistenceManagerFactory to specify if
135      * the query must prefetch the data. The default value is true.
136      */

137     String JavaDoc TX_LISTENER = SPEEDO + ".txListener";
138     String JavaDoc CONNECTION_POOL_MIN = SPEEDO + ".connection.pool.min";
139     String JavaDoc CONNECTION_POOL_MAX = SPEEDO + ".connection.pool.max";
140     String JavaDoc CONNECTION_POOL_TTL = SPEEDO + ".connection.pool.ttl";
141     String JavaDoc CONNECTION_POOL_INACTIVETTL = SPEEDO + ".connection.pool.inactivettl";
142     String JavaDoc CONNECTION_POOL_TIMEOUT = SPEEDO + ".connection.pool.timeout";
143
144
145     // Constant usable in the .jdo files (keys of the extension tags)
146

147     String JavaDoc VENDOR_NAME = "speedo";
148
149     String JavaDoc ID = "id";
150     String JavaDoc ID_SEQUENCE = "sequence";
151     String JavaDoc ID_POLYMORPH_2L = "polymorph2l";
152     String JavaDoc ID_LONG = "long";
153     String JavaDoc ID_OLONG = "java.lang.Long";
154
155     /**
156      * is a string used in an extension tag in a.jdo file to specify
157      * the sql column for a primitive field (not a reference).
158      */

159     String JavaDoc SQL_NAME = "sql-name";
160
161     /**
162      * the INHERITANCE_MAPPING property permits to specifies the mapping type
163      * concerning the inheritance aspect.
164      */

165     String JavaDoc INHERITANCE_MAPPING = "inheritance-mapping";
166     String JavaDoc INHERITANCE_FILTERED_MAPPING = "filtered";
167     String JavaDoc INHERITANCE_HORIZONTAL_MAPPING = "horizontal";
168     String JavaDoc INHERITANCE_VERTICAL_MAPPING = "vertical";
169
170     String JavaDoc INHERITANCE_FILTER = "inheritance-filter";
171     String JavaDoc INHERITANCE_KEY = "inheritance-key";
172
173     /**
174      * is a string used in an extension tag in a.jdo file to specify
175      * the name of the sequence used for the datastore id.
176      */

177     String JavaDoc SQL_SEQ_NAME = "sql-seq-name";
178     String JavaDoc SQL_SEQ_START = "sql-seq-start";
179     String JavaDoc SQL_SEQ_INC = "sql-seq-increment";
180     String JavaDoc SQL_SEQ_CACHE = "sql-seq-cache";
181     String JavaDoc SQL_SEQ_ALLOCATOR = "sql-seq-allocator";
182
183     /**
184      * is a string to used in an extension tag in a.jdo file to specify
185      * the sql type for a primitive field (not a reference).
186      */

187     String JavaDoc SQL_TYPE = "sql-type";
188
189     /**
190      * is a string to used in an extension tag in a.jdo file to specify
191      * the size of primitive field (not a reference).
192      */

193     String JavaDoc SIZE = "size";
194
195     /**
196      * is a string to used in an extension tag in a.jdo file to specify
197      * the scale of primitive field (not a reference).
198      */

199     String JavaDoc SCALE = "scale";
200
201     /**
202      * is a string to used in an extension tag in a.jdo file to specify
203      * the foreign keys referencing the current persistent object.
204      */

205     String JavaDoc SOURCE_FK = "source-foreign-keys";
206
207     /**
208      * is a string to used in an extension tag in a.jdo file to specify
209      * the foreign keys referencing the referenced persistent object.
210      */

211     String JavaDoc TARGET_FK = "target-foreign-keys";
212
213     /**
214      * is a string to used in an extension tag in a.jdo file to specify
215      * the name of the reverse field.
216      */

217     String JavaDoc REVERSE_FIELD = "reverse-field";
218
219     /**
220      * is a string to used in an extension tag in a.jdo file to specify
221      * the if persistent instance referenced by a field, must be removed when
222      * the current class is deleted.
223      */

224     String JavaDoc CASCADE_DELETE = "cascade-delete";
225
226     /**
227      * is a string to used in an extension tag in a.jdo file to specify
228      * the name of the join table in a multivalued reference (Collection, Map,
229      * Array, Set, List).
230      */

231     String JavaDoc JOIN_TABLE = "join-table";
232
233     /**
234      * is a string to used in an extension tag in a.jdo file to specify
235      * the name of the class permiting the conversion of a field between the
236      * memory and the data support.
237      */

238     String JavaDoc FIELD_CONVERTER = "field-converter";
239
240     /**
241      * is a string to used in an extension tag in a.jdo file to specify
242      * the column name of the index of the list or of the key in a map.
243      */

244     String JavaDoc INDEX = "index-sql-name";
245
246     String JavaDoc INDEX_TYPE = "index-sql-type";
247
248     /**
249      * is a string to used in an extension tag in a.jdo file to specify
250      * the column name of the element of the list or of the value in a map,
251      * when the element is a prmitive.
252      */

253     String JavaDoc ELEMENT = "element-sql-name";
254
255     String JavaDoc ELEMENT_TYPE = "element-sql-type";
256     
257     String JavaDoc KEY_FIELD = "key-field";
258
259     /**
260      * Optionals features supported by JDO implementation (see supportedOptions();)
261      */

262     String JavaDoc JDO_OPTION_TRANSIENT_TRANSACTIONAL = "javax.jdo.option.TransientTransactional";
263     String JavaDoc JDO_OPTION_NON_TRANSACTIONAL_READ = "javax.jdo.option.NontransactionalRead";
264     String JavaDoc JDO_OPTION_NON_TRANSACTIONAL_WRITE = "javax.jdo.option.NontransactionalWrite";
265     String JavaDoc JDO_OPTION_RETAIN_VALUES = "javax.jdo.option.RetainValues";
266     String JavaDoc JDO_OPTION_OPTIMISTIC = "javax.jdo.option.Optimistic";
267     String JavaDoc JDO_OPTION_APPLICATION_IDENTITY = "javax.jdo.option.ApplicationIdentity";
268     String JavaDoc JDO_OPTION_DATASTORE_IDENTITY = "javax.jdo.option.DatastoreIdentity";
269     String JavaDoc JDO_OPTION_NON_DURABLE_IDENTITY = "javax.jdo.option.NonDurableIdentity";
270     String JavaDoc JDO_OPTION_ARRAY_LIST = "javax.jdo.option.ArrayList";
271     String JavaDoc JDO_OPTION_HASH_MAP = "javax.jdo.option.HashMap";
272     String JavaDoc JDO_OPTION_HASH_TABLE = "javax.jdo.option.Hashtable";
273     String JavaDoc JDO_OPTION_LINKED_LIST = "javax.jdo.option.LinkedList";
274     String JavaDoc JDO_OPTION_TREE_MAP = "javax.jdo.option.TreeMap";
275     String JavaDoc JDO_OPTION_TREE_SET = "javax.jdo.option.TreeSet";
276     String JavaDoc JDO_OPTION_VECTOR = "javax.jdo.option.Vector";
277     String JavaDoc JDO_OPTION_MAP = "javax.jdo.option.Map";
278     String JavaDoc JDO_OPTION_LIST= "javax.jdo.option.List";
279     String JavaDoc JDO_OPTION_ARRAY = "javax.jdo.option.Array";
280     String JavaDoc JDO_OPTION_NULL_COLLECTION = "javax.jdo.option.NullCollection";
281     String JavaDoc JDO_OPTION_CHANGE_APPLICATION_IDENTITY = "javax.jdo.option.ChangeApplicationIdentity";
282     String JavaDoc JDO_QUERY_JDOQL = "javax.jdo.query.JDOQL";
283     
284         
285     /**
286      * Key values for Properties configuration options
287      */

288     String JavaDoc JDO_PERSISTENCE_MANAGER_FACTORY_CLASS = "javax.jdo.PersistenceManagerFactoryClass";
289     String JavaDoc JDO_OPTION_RESTORE_VALUES = "javax.jdo.option.RestoreValues";
290     String JavaDoc JDO_OPTION_IGNORE_CACHE = "javax.jdo.option.IgnoreCache";
291     String JavaDoc JDO_OPTION_MULTITREADED = "javax.jdo.option.Multithreaded";
292     String JavaDoc JDO_OPTION_CONNECTION_DRIVER_NAME_old = "javax.jdo.option.DriverClassName";
293     String JavaDoc JDO_OPTION_CONNECTION_DRIVER_NAME_old2 = "javax.jdo.option.DriverName";
294     String JavaDoc JDO_OPTION_CONNECTION_DRIVER_NAME = "javax.jdo.option.ConnectionDriverName";
295     String JavaDoc JDO_OPTION_CONNECTION_USER_NAME = "javax.jdo.option.ConnectionUserName";
296     String JavaDoc JDO_OPTION_CONNECTION_PASSWORD = "javax.jdo.option.ConnectionPassword";
297     String JavaDoc JDO_OPTION_CONNECTION_URL = "javax.jdo.option.ConnectionURL";
298     String JavaDoc JDO_OPTION_CONNECTION_FACTORY_NAME = "javax.jdo.option.ConnectionFactoryName";
299     String JavaDoc JDO_OPTION_CONNECTION_FACTORY2_NAME = "javax.jdo.option.ConnectionFactor2yName";
300     String JavaDoc JDO_OPTION_MAPPING = "javax.jdo.option.ConnectionUserName";
301     
302     
303     String JavaDoc MAPPER_NAME = SPEEDO + ".mapperName";
304     String JavaDoc TRANSACTION_LOCKING = SPEEDO + ".transaction.locking";
305     String JavaDoc SPEEDO_TRANSACTION_LOCKING = "speedo";
306     String JavaDoc DB_TRANSACTION_LOCKING = "database";
307
308     String JavaDoc TRANSACTION_LOCKING_PESSIMISTIC_POLICY = SPEEDO + ".transaction.locking.pessimistic.policy";
309     String JavaDoc TRANSACTION_LOCKING_PESSIMISTIC_POLICY_MUTEX = "mutex";
310     String JavaDoc TRANSACTION_LOCKING_PESSIMISTIC_POLICY_RW_FIFO = "rw";
311     
312     String JavaDoc TRANSACTION_LOCKING_LEVEL_ENABLETHIN = SPEEDO + ".transaction.locking.level.enablethin";
313     String JavaDoc TRANSACTION_LOCKING_LEVEL = SPEEDO + ".transaction.locking.level";
314     String JavaDoc TRANSACTION_LOCKING_LEVEL_INSTANCE = "instance";
315     String JavaDoc TRANSACTION_LOCKING_LEVEL_FIELD = "field";
316     String JavaDoc TRANSACTION_MODE = SPEEDO + ".transaction.mode";
317     String JavaDoc TRANSACTION_MODE_NORMAL = "NORMAL";
318     String JavaDoc TRANSACTION_MODE_REQUIRED = "REQUIRED";
319     String JavaDoc TRANSACTION_MODE_UT = "USER_TRANSACTION";
320     byte TRANSACTION_BMODE_NORMAL = 0x1;
321     byte TRANSACTION_BMODE_REQUIRED= 0x2;
322     byte TRANSACTION_BMODE_UT = 0x3;
323     
324     
325     String JavaDoc IMRICATED_PM_ALLOWED = SPEEDO + ".imbricated-persistence-manager";
326     String JavaDoc CONNECTION_CHECK = SPEEDO + ".connection.check";
327     
328     String JavaDoc JMX = SPEEDO + ".jmx";
329     String JavaDoc JMX_HTTP_PORT = SPEEDO + ".jmx.http.port";
330     
331     public final static int EXTENSION_JDO_IDX = 0;
332     public final static int EXTENSION_PACKAGE_IDX = 1;
333     public final static int EXTENSION_CLASS_IDX = 2;
334     public final static int EXTENSION_FIELD_IDX = 3;
335     public final static int EXTENSION_COLLECTION_IDX = 4;
336     public final static int EXTENSION_MAP_IDX = 5;
337
338     /**
339      * Defines the supported speedo extentsion on each xml node of the .jdo file
340      */

341     public final static List JavaDoc SUPPORTED_EXTENSION = Arrays.asList(new List JavaDoc[]{
342         Collections.EMPTY_LIST, //jdo
343
Collections.EMPTY_LIST, //package
344
Arrays.asList(new String JavaDoc[]{SQL_NAME,
345                                    SQL_SEQ_CACHE,
346                                    SQL_SEQ_INC,
347                                    SQL_SEQ_NAME,
348                                    SQL_SEQ_START,
349                                    SQL_SEQ_ALLOCATOR,
350                                    ID,
351                                    INHERITANCE_MAPPING,
352                                    INHERITANCE_KEY,
353                                    INHERITANCE_FILTER}), //class
354
Arrays.asList(new String JavaDoc[]{SQL_NAME,
355                                    SQL_TYPE,
356                                    SIZE,
357                                    SOURCE_FK,
358                                    TARGET_FK,
359                                    JOIN_TABLE,
360                                    REVERSE_FIELD,
361                                    ELEMENT,
362                                    ELEMENT_TYPE,
363                                    INDEX,
364                                    INDEX_TYPE,
365                                    FIELD_CONVERTER,
366                                    CASCADE_DELETE,
367                                    KEY_FIELD,
368                                    USER_CACHE}),//field
369
Arrays.asList(new String JavaDoc[]{ELEMENT,
370                                    ELEMENT_TYPE,
371                                    INDEX,
372                                    INDEX_TYPE}),//collection
373
Arrays.asList(new String JavaDoc[]{ELEMENT,
374                                    ELEMENT_TYPE,
375                                    INDEX,
376                                    INDEX_TYPE,
377                                    KEY_FIELD}),//map
378
});
379 }
380
Popular Tags