KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > common > config > ConfigInfo


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.common.config;
13
14 import java.util.*;
15
16 import com.versant.core.common.BindingSupportImpl;
17 import com.versant.core.metadata.parser.JdoRoot;
18
19 /**
20  * This wraps a properties instance to provide access to the keys in a sorted
21  * order.
22  */

23 public class ConfigInfo {
24
25     public Properties props;
26     public String JavaDoc url;
27     public String JavaDoc db;
28     public String JavaDoc serverName;
29     public boolean allowPmCloseWithOpenTx;
30     public boolean precompileNamedQueries;
31     public boolean checkModelConsistencyOnCommit;
32     public boolean interceptDfgFieldAccess;
33     public boolean hyperdrive;
34     public String JavaDoc hyperdriveSrcDir;
35     public String JavaDoc hyperdriveClassDir;
36     public boolean keepHyperdriveBytecode;
37     public int pmCacheRefType;
38     public boolean testing;
39
40     public String JavaDoc remoteAccess;
41
42     public boolean retainValues;
43     public boolean restoreValues;
44     public boolean optimistic;
45     public boolean nontransactionalRead;
46     public boolean nontransactionalWrite;
47     public boolean ignoreCache;
48     public boolean multithreaded;
49     public String JavaDoc connectionFactoryName;
50     public String JavaDoc connectionFactory2Name;
51
52     public boolean pmpoolEnabled;
53     public int pmpoolMaxIdle;
54
55     public boolean remotePmpoolEnabled;
56     public int remotePmpoolMaxIdle;
57     public int remotePmpoolMaxActive;
58
59     /**
60      * If query results to be cached.
61      */

62     public boolean queryCacheEnabled;
63     public int maxQueriesToCache;
64     public int compiledQueryCacheSize;
65
66     /**
67      * The names of .jdo and .jdoql resources.
68      */

69     public ArrayList jdoResources = new ArrayList();
70     public JdoRoot[] jdoMetaData;
71
72     public Map perfProps;
73
74     public boolean useCache;
75     public int cacheMaxObjects;
76     public String JavaDoc cacheListenerClass;
77     public Map cacheListenerProps;
78
79     public int flushThreshold;
80     public int datastoreTxLocking;
81     public int retainConnectionInOptTx; // MdStatics.NOT_SET, FALSE, TRUE
82

83     public int metricStoreCapacity;
84     public int metricSnapshotIntervalMs;
85     public ArrayList userBaseMetrics = new ArrayList(); // of UserBaseMetric
86

87     public String JavaDoc logDownloaderClass;
88     public Map logDownloaderProps;
89
90     public List externalizers = new ArrayList(); // of ExternalizerInfo
91
public Map scoFactoryRegistryMappings = new HashMap();
92     public String JavaDoc metaDataPreProcessor;
93
94     /**
95      * Info on a user-defined base metric.
96      */

97     public static class UserBaseMetric {
98         public String JavaDoc name;
99         public String JavaDoc displayName;
100         public String JavaDoc category;
101         public String JavaDoc description;
102         public int defaultCalc;
103         public int decimals;
104     }
105
106     /**
107      * Info on an externalizer.
108      */

109     public static class ExternalizerInfo {
110         public String JavaDoc typeName;
111         public boolean enabled;
112         public String JavaDoc externalizerName;
113         public Map args = new HashMap(17);
114     }
115
116     /**
117      * Perform basic validation. There must be at least one store and jdo
118      * file.
119      */

120     public void validate() {
121         if (jdoResources.isEmpty()) {
122             throw BindingSupportImpl.getInstance().runtime(
123                     "At least one jdoNNN property is required");
124         }
125     }
126
127     /**
128      * Get the names of .jdo and .jdoql resources.
129      */

130     public String JavaDoc[] getJdoResources() {
131         String JavaDoc[] a = new String JavaDoc[jdoResources.size()];
132         jdoResources.toArray(a);
133         return a;
134     }
135 }
136
Popular Tags