KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sleepycat > je > CursorConfig


1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2002,2006 Oracle. All rights reserved.
5  *
6  * $Id: CursorConfig.java,v 1.18 2006/11/20 15:46:58 cwl Exp $
7  */

8
9 package com.sleepycat.je;
10
11 /**
12  * Javadoc for this public class is generated
13  * via the doc templates in the doc_src directory.
14  */

15 public class CursorConfig implements Cloneable JavaDoc {
16
17     /**
18      * Javadoc for this public instance is generated via
19      * the doc templates in the doc_src directory.
20      */

21     public static final CursorConfig DEFAULT = new CursorConfig();
22
23     /**
24      * Javadoc for this public instance is generated via
25      * the doc templates in the doc_src directory.
26      */

27     public static final CursorConfig READ_UNCOMMITTED = new CursorConfig();
28
29     /**
30      * Javadoc for this public instance is generated via
31      * the doc templates in the doc_src directory.
32      * @deprecated
33      */

34     public static final CursorConfig DIRTY_READ = READ_UNCOMMITTED;
35
36     /**
37      * Javadoc for this public instance is generated via
38      * the doc templates in the doc_src directory.
39      */

40     public static final CursorConfig READ_COMMITTED = new CursorConfig();
41     
42     static {
43         READ_UNCOMMITTED.setReadUncommitted(true);
44         READ_COMMITTED.setReadCommitted(true);
45     }
46
47     private boolean readUncommitted = false;
48     private boolean readCommitted = false;
49
50     /**
51      * Javadoc for this public method is generated via
52      * the doc templates in the doc_src directory.
53      */

54     public CursorConfig() {
55     }
56
57     /**
58      * Javadoc for this public method is generated via
59      * the doc templates in the doc_src directory.
60      */

61     public void setReadUncommitted(boolean readUncommitted) {
62         this.readUncommitted = readUncommitted;
63     }
64
65     /**
66      * Javadoc for this public method is generated via
67      * the doc templates in the doc_src directory.
68      */

69     public boolean getReadUncommitted() {
70         return readUncommitted;
71     }
72
73     /**
74      * Javadoc for this public method is generated via
75      * the doc templates in the doc_src directory.
76      * @deprecated
77      */

78     public void setDirtyRead(boolean dirtyRead) {
79         setReadUncommitted(dirtyRead);
80     }
81
82     /**
83      * Javadoc for this public method is generated via
84      * the doc templates in the doc_src directory.
85      * @deprecated
86      */

87     public boolean getDirtyRead() {
88         return getReadUncommitted();
89     }
90
91     /**
92      * Javadoc for this public method is generated via
93      * the doc templates in the doc_src directory.
94      */

95     public void setReadCommitted(boolean readCommitted) {
96         this.readCommitted = readCommitted;
97     }
98
99     /**
100      * Javadoc for this public method is generated via
101      * the doc templates in the doc_src directory.
102      */

103     public boolean getReadCommitted() {
104         return readCommitted;
105     }
106
107     /**
108      * Internal method used by Cursor to create a copy of the application
109      * supplied configuration. Done this way to provide non-public cloning.
110      */

111     CursorConfig cloneConfig() {
112         try {
113             return (CursorConfig) super.clone();
114         } catch (CloneNotSupportedException JavaDoc willNeverOccur) {
115             return null;
116         }
117     }
118 }
119
Popular Tags