001: /*-
002: * See the file LICENSE for redistribution information.
003: *
004: * Copyright (c) 2002,2008 Oracle. All rights reserved.
005: *
006: * $Id: CursorConfig.java,v 1.18.2.3 2008/01/07 15:14:07 cwl Exp $
007: */
008:
009: package com.sleepycat.je;
010:
011: /**
012: * Javadoc for this public class is generated
013: * via the doc templates in the doc_src directory.
014: */
015: public class CursorConfig implements Cloneable {
016:
017: /**
018: * Javadoc for this public instance is generated via
019: * the doc templates in the doc_src directory.
020: */
021: public static final CursorConfig DEFAULT = new CursorConfig();
022:
023: /**
024: * Javadoc for this public instance is generated via
025: * the doc templates in the doc_src directory.
026: */
027: public static final CursorConfig READ_UNCOMMITTED = new CursorConfig();
028:
029: /**
030: * Javadoc for this public instance is generated via
031: * the doc templates in the doc_src directory.
032: * @deprecated
033: */
034: public static final CursorConfig DIRTY_READ = READ_UNCOMMITTED;
035:
036: /**
037: * Javadoc for this public instance is generated via
038: * the doc templates in the doc_src directory.
039: */
040: public static final CursorConfig READ_COMMITTED = new CursorConfig();
041:
042: static {
043: READ_UNCOMMITTED.setReadUncommitted(true);
044: READ_COMMITTED.setReadCommitted(true);
045: }
046:
047: private boolean readUncommitted = false;
048: private boolean readCommitted = false;
049:
050: /**
051: * Javadoc for this public method is generated via
052: * the doc templates in the doc_src directory.
053: */
054: public CursorConfig() {
055: }
056:
057: /**
058: * Javadoc for this public method is generated via
059: * the doc templates in the doc_src directory.
060: */
061: public void setReadUncommitted(boolean readUncommitted) {
062: this .readUncommitted = readUncommitted;
063: }
064:
065: /**
066: * Javadoc for this public method is generated via
067: * the doc templates in the doc_src directory.
068: */
069: public boolean getReadUncommitted() {
070: return readUncommitted;
071: }
072:
073: /**
074: * Javadoc for this public method is generated via
075: * the doc templates in the doc_src directory.
076: * @deprecated
077: */
078: public void setDirtyRead(boolean dirtyRead) {
079: setReadUncommitted(dirtyRead);
080: }
081:
082: /**
083: * Javadoc for this public method is generated via
084: * the doc templates in the doc_src directory.
085: * @deprecated
086: */
087: public boolean getDirtyRead() {
088: return getReadUncommitted();
089: }
090:
091: /**
092: * Javadoc for this public method is generated via
093: * the doc templates in the doc_src directory.
094: */
095: public void setReadCommitted(boolean readCommitted) {
096: this .readCommitted = readCommitted;
097: }
098:
099: /**
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 willNeverOccur) {
115: return null;
116: }
117: }
118: }
|