Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

LockMode.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2002-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: LockMode.java,v 12.2 2005/06/16 20:23:02 bostic Exp $
00008  */
00009 
00010 package com.sleepycat.db;
00011 
00012 import com.sleepycat.db.internal.DbConstants;
00013 
00014 public final class LockMode {
00015     private String lockModeName;
00016     private int flag;
00017 
00018     private LockMode(String lockModeName, int flag) {
00019         this.lockModeName = lockModeName;
00020         this.flag = flag;
00021     }
00022 
00023     public static final LockMode DEFAULT =
00024         new LockMode("DEFAULT", 0);
00025     public static final LockMode READ_UNCOMMITTED =
00026         new LockMode("READ_UNCOMMITTED", DbConstants.DB_READ_UNCOMMITTED);
00027     public static final LockMode READ_COMMITTED =
00028         new LockMode("READ_COMMITTED", DbConstants.DB_READ_COMMITTED);
00029     public static final LockMode RMW =
00030         new LockMode("RMW", DbConstants.DB_RMW);
00031 
00033     public static final LockMode DIRTY_READ = READ_UNCOMMITTED;
00035     public static final LockMode DEGREE_2 = READ_COMMITTED;
00036 
00037     public String toString() {
00038         return "LockMode." + lockModeName;
00039     }
00040 
00041     /* package */
00042     static int getFlag(LockMode mode) {
00043         return ((mode == null) ? DEFAULT : mode).flag;
00044     }
00045 }

Generated on Sun Dec 25 12:14:33 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2