001: /*-
002: * See the file LICENSE for redistribution information.
003: *
004: * Copyright (c) 2002,2008 Oracle. All rights reserved.
005: *
006: * $Id: TransactionConfig.java,v 1.15.2.3 2008/01/07 15:14:08 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 TransactionConfig implements Cloneable {
016:
017: /**
018: * Javadoc for this public method is generated via
019: * the doc templates in the doc_src directory.
020: */
021: public static final TransactionConfig DEFAULT = new TransactionConfig();
022:
023: private boolean sync = false;
024: private boolean noSync = false;
025: private boolean writeNoSync = false;
026: private boolean noWait = false;
027: private boolean readUncommitted = false;
028: private boolean readCommitted = false;
029: private boolean serializableIsolation = false;
030:
031: /**
032: * Javadoc for this public method is generated via
033: * the doc templates in the doc_src directory.
034: */
035: public TransactionConfig() {
036: }
037:
038: /**
039: * Javadoc for this public method is generated via
040: * the doc templates in the doc_src directory.
041: */
042: public void setSync(boolean sync) {
043: this .sync = sync;
044: }
045:
046: /**
047: * Javadoc for this public method is generated via
048: * the doc templates in the doc_src directory.
049: */
050: public boolean getSync() {
051: return sync;
052: }
053:
054: /**
055: * Javadoc for this public method is generated via
056: * the doc templates in the doc_src directory.
057: */
058: public void setNoSync(boolean noSync) {
059: this .noSync = noSync;
060: }
061:
062: /**
063: * Javadoc for this public method is generated via
064: * the doc templates in the doc_src directory.
065: */
066: public boolean getNoSync() {
067: return noSync;
068: }
069:
070: /**
071: * Javadoc for this public method is generated via
072: * the doc templates in the doc_src directory.
073: */
074: public void setWriteNoSync(boolean writeNoSync) {
075: this .writeNoSync = writeNoSync;
076: }
077:
078: /**
079: * Javadoc for this public method is generated via
080: * the doc templates in the doc_src directory.
081: */
082: public boolean getWriteNoSync() {
083: return writeNoSync;
084: }
085:
086: /**
087: * Javadoc for this public method is generated via
088: * the doc templates in the doc_src directory.
089: */
090: public void setNoWait(boolean noWait) {
091: this .noWait = noWait;
092: }
093:
094: /**
095: * Javadoc for this public method is generated via
096: * the doc templates in the doc_src directory.
097: */
098: public boolean getNoWait() {
099: return noWait;
100: }
101:
102: /**
103: * Javadoc for this public method is generated via
104: * the doc templates in the doc_src directory.
105: */
106: public void setReadUncommitted(boolean readUncommitted) {
107: this .readUncommitted = readUncommitted;
108: }
109:
110: /**
111: * Javadoc for this public method is generated via
112: * the doc templates in the doc_src directory.
113: */
114: public boolean getReadUncommitted() {
115: return readUncommitted;
116: }
117:
118: /**
119: * Javadoc for this public method is generated via
120: * the doc templates in the doc_src directory.
121: * @deprecated
122: */
123: public void setDirtyRead(boolean dirtyRead) {
124: setReadUncommitted(dirtyRead);
125: }
126:
127: /**
128: * Javadoc for this public method is generated via
129: * the doc templates in the doc_src directory.
130: * @deprecated
131: */
132: public boolean getDirtyRead() {
133: return getReadUncommitted();
134: }
135:
136: /**
137: * Javadoc for this public method is generated via
138: * the doc templates in the doc_src directory.
139: */
140: public void setReadCommitted(boolean readCommitted) {
141: this .readCommitted = readCommitted;
142: }
143:
144: /**
145: * Javadoc for this public method is generated via
146: * the doc templates in the doc_src directory.
147: */
148: public boolean getReadCommitted() {
149: return readCommitted;
150: }
151:
152: /**
153: * Javadoc for this public method is generated via
154: * the doc templates in the doc_src directory.
155: */
156: public void setSerializableIsolation(boolean serializableIsolation) {
157: this .serializableIsolation = serializableIsolation;
158: }
159:
160: /**
161: * Javadoc for this public method is generated via
162: * the doc templates in the doc_src directory.
163: */
164: public boolean getSerializableIsolation() {
165: return serializableIsolation;
166: }
167:
168: /**
169: * Used by Environment to create a copy of the application
170: * supplied configuration. Done this way to provide non-public cloning.
171: */
172: TransactionConfig cloneConfig() {
173: try {
174: return (TransactionConfig) super .clone();
175: } catch (CloneNotSupportedException willNeverOccur) {
176: return null;
177: }
178: }
179: }
|