Source Code Cross Referenced for EnvironmentConfig.java in  » JMX » je » com » sleepycat » je » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » JMX » je » com.sleepycat.je 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*-
002:         * See the file LICENSE for redistribution information.
003:         *
004:         * Copyright (c) 2002,2008 Oracle.  All rights reserved.
005:         *
006:         * $Id: EnvironmentConfig.java,v 1.35.2.3 2008/01/07 15:14:08 cwl Exp $
007:         */
008:
009:        package com.sleepycat.je;
010:
011:        import java.util.Properties;
012:
013:        import com.sleepycat.je.config.EnvironmentParams;
014:        import com.sleepycat.je.dbi.DbConfigManager;
015:
016:        /**
017:         * Javadoc for this public class is generated
018:         * via the doc templates in the doc_src directory.
019:         */
020:        public class EnvironmentConfig extends EnvironmentMutableConfig {
021:            /*
022:             * For internal use, to allow null as a valid value for
023:             * the config parameter.
024:             */
025:            public static final EnvironmentConfig DEFAULT = new EnvironmentConfig();
026:
027:            /**
028:             * For unit testing, to prevent creating the utilization profile DB.
029:             */
030:            private boolean createUP = true;
031:
032:            /**
033:             * For unit testing, to prevent writing utilization data during checkpoint.
034:             */
035:            private boolean checkpointUP = true;
036:
037:            private boolean allowCreate = false;
038:
039:            /**
040:             * For unit testing, to set readCommitted as the default.
041:             */
042:            private boolean txnReadCommitted = false;
043:
044:            private ExceptionListener exceptionListener = null;
045:
046:            /**
047:             * Javadoc for this public method is generated via
048:             * the doc templates in the doc_src directory.
049:             */
050:            public EnvironmentConfig() {
051:                super ();
052:            }
053:
054:            /**
055:             * Javadoc for this public method is generated via
056:             * the doc templates in the doc_src directory.
057:             */
058:            public EnvironmentConfig(Properties properties)
059:                    throws IllegalArgumentException {
060:
061:                super (properties);
062:            }
063:
064:            /**
065:             * Javadoc for this public method is generated via
066:             * the doc templates in the doc_src directory.
067:             */
068:            public void setAllowCreate(boolean allowCreate) {
069:
070:                this .allowCreate = allowCreate;
071:            }
072:
073:            /**
074:             * Javadoc for this public method is generated via
075:             * the doc templates in the doc_src directory.
076:             */
077:            public boolean getAllowCreate() {
078:
079:                return allowCreate;
080:            }
081:
082:            /**
083:             * Javadoc for this public method is generated via
084:             * the doc templates in the doc_src directory.
085:             */
086:            public void setLockTimeout(long timeout)
087:                    throws IllegalArgumentException {
088:
089:                DbConfigManager.setVal(props, EnvironmentParams.LOCK_TIMEOUT,
090:                        Long.toString(timeout), validateParams);
091:            }
092:
093:            /**
094:             * Javadoc for this public method is generated via
095:             * the doc templates in the doc_src directory.
096:             */
097:            public long getLockTimeout() {
098:
099:                String val = DbConfigManager.getVal(props,
100:                        EnvironmentParams.LOCK_TIMEOUT);
101:                long timeout = 0;
102:                try {
103:                    timeout = Long.parseLong(val);
104:                } catch (NumberFormatException e) {
105:                    throw new IllegalArgumentException("Bad value for timeout:"
106:                            + e.getMessage());
107:                }
108:                return timeout;
109:            }
110:
111:            /**
112:             * Javadoc for this public method is generated via
113:             * the doc templates in the doc_src directory.
114:             */
115:            public void setReadOnly(boolean readOnly) {
116:
117:                DbConfigManager.setVal(props, EnvironmentParams.ENV_RDONLY,
118:                        Boolean.toString(readOnly), validateParams);
119:            }
120:
121:            /**
122:             * Javadoc for this public method is generated via
123:             * the doc templates in the doc_src directory.
124:             */
125:            public boolean getReadOnly() {
126:
127:                String val = DbConfigManager.getVal(props,
128:                        EnvironmentParams.ENV_RDONLY);
129:                return (Boolean.valueOf(val)).booleanValue();
130:            }
131:
132:            /**
133:             * Javadoc for this public method is generated via
134:             * the doc templates in the doc_src directory.
135:             */
136:            public void setTransactional(boolean transactional) {
137:
138:                DbConfigManager.setVal(props, EnvironmentParams.ENV_INIT_TXN,
139:                        Boolean.toString(transactional), validateParams);
140:            }
141:
142:            /**
143:             * Javadoc for this public method is generated via
144:             * the doc templates in the doc_src directory.
145:             */
146:            public boolean getTransactional() {
147:
148:                String val = DbConfigManager.getVal(props,
149:                        EnvironmentParams.ENV_INIT_TXN);
150:                return (Boolean.valueOf(val)).booleanValue();
151:            }
152:
153:            /**
154:             * Javadoc for this public method is generated via
155:             * the doc templates in the doc_src directory.
156:             */
157:            public void setLocking(boolean locking) {
158:
159:                DbConfigManager.setVal(props,
160:                        EnvironmentParams.ENV_INIT_LOCKING, Boolean
161:                                .toString(locking), validateParams);
162:            }
163:
164:            /**
165:             * Javadoc for this public method is generated via
166:             * the doc templates in the doc_src directory.
167:             */
168:            public boolean getLocking() {
169:
170:                String val = DbConfigManager.getVal(props,
171:                        EnvironmentParams.ENV_INIT_LOCKING);
172:                return (Boolean.valueOf(val)).booleanValue();
173:            }
174:
175:            /**
176:             * Javadoc for this public method is generated via
177:             * the doc templates in the doc_src directory.
178:             */
179:            public void setTxnTimeout(long timeout)
180:                    throws IllegalArgumentException {
181:
182:                DbConfigManager.setVal(props, EnvironmentParams.TXN_TIMEOUT,
183:                        Long.toString(timeout), validateParams);
184:            }
185:
186:            /**
187:             * Javadoc for this public method is generated via
188:             * the doc templates in the doc_src directory.
189:             */
190:            public long getTxnTimeout() {
191:
192:                String val = DbConfigManager.getVal(props,
193:                        EnvironmentParams.TXN_TIMEOUT);
194:                long timeout = 0;
195:                try {
196:                    timeout = Long.parseLong(val);
197:                } catch (NumberFormatException e) {
198:                    throw new IllegalArgumentException("Bad value for timeout:"
199:                            + e.getMessage());
200:                }
201:                return timeout;
202:            }
203:
204:            /**
205:             * Javadoc for this public method is generated via
206:             * the doc templates in the doc_src directory.
207:             */
208:            public void setTxnSerializableIsolation(
209:                    boolean txnSerializableIsolation) {
210:
211:                DbConfigManager.setVal(props,
212:                        EnvironmentParams.TXN_SERIALIZABLE_ISOLATION, Boolean
213:                                .toString(txnSerializableIsolation),
214:                        validateParams);
215:            }
216:
217:            /**
218:             * Javadoc for this public method is generated via
219:             * the doc templates in the doc_src directory.
220:             */
221:            public boolean getTxnSerializableIsolation() {
222:
223:                String val = DbConfigManager.getVal(props,
224:                        EnvironmentParams.TXN_SERIALIZABLE_ISOLATION);
225:                return (Boolean.valueOf(val)).booleanValue();
226:            }
227:
228:            /**
229:             * Javadoc for this public method is generated via
230:             * the doc templates in the doc_src directory.
231:             */
232:            public void setExceptionListener(ExceptionListener exceptionListener) {
233:                this .exceptionListener = exceptionListener;
234:            }
235:
236:            /**
237:             * Javadoc for this public method is generated via
238:             * the doc templates in the doc_src directory.
239:             */
240:            public ExceptionListener getExceptionListener() {
241:                return exceptionListener;
242:            }
243:
244:            /**
245:             * For unit testing, to set readCommitted as the default.
246:             */
247:            void setTxnReadCommitted(boolean txnReadCommitted) {
248:
249:                this .txnReadCommitted = txnReadCommitted;
250:            }
251:
252:            /**
253:             * For unit testing, to set readCommitted as the default.
254:             */
255:            boolean getTxnReadCommitted() {
256:
257:                return txnReadCommitted;
258:            }
259:
260:            /**
261:             * Javadoc for this public method is generated via
262:             * the doc templates in the doc_src directory.
263:             */
264:            public void setConfigParam(String paramName, String value)
265:                    throws IllegalArgumentException {
266:
267:                DbConfigManager.setConfigParam(props, paramName, value, false, /* requireMutablity */
268:                validateParams, false /* forReplication */);
269:            }
270:
271:            /**
272:             * For unit testing, to prevent creating the utilization profile DB.
273:             */
274:            void setCreateUP(boolean createUP) {
275:                this .createUP = createUP;
276:            }
277:
278:            /**
279:             * For unit testing, to prevent creating the utilization profile DB.
280:             */
281:            boolean getCreateUP() {
282:                return createUP;
283:            }
284:
285:            /**
286:             * For unit testing, to prevent writing utilization data during checkpoint.
287:             */
288:            void setCheckpointUP(boolean checkpointUP) {
289:                this .checkpointUP = checkpointUP;
290:            }
291:
292:            /**
293:             * For unit testing, to prevent writing utilization data during checkpoint.
294:             */
295:            boolean getCheckpointUP() {
296:                return checkpointUP;
297:            }
298:
299:            /**
300:             * Used by Environment to create a copy of the application
301:             * supplied configuration.
302:             */
303:            EnvironmentConfig cloneConfig() {
304:                try {
305:                    return (EnvironmentConfig) clone();
306:                } catch (CloneNotSupportedException willNeverOccur) {
307:                    return null;
308:                }
309:            }
310:
311:            public String toString() {
312:                return ("allowCreate=" + allowCreate + "\n" + super.toString());
313:            }
314:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.