1/*- 2 * See the file LICENSE for redistribution information. 3 * 4 * Copyright (c) 2001,2008 Oracle. All rights reserved. 5 * 6 * $Id: Lock.java,v 12.8 2008/01/17 05:04:53 mjc Exp $ 7 */ 8 9package com.sleepycat.db; 10 11import com.sleepycat.db.internal.DbLock; 12 13/** 14 * The locking interfaces for the database environment are methods of the 15 * {@link com.sleepycat.db.Environment Environment} handle. The {@link 16 * com.sleepycat.db.Lock Lock} object is the handle for a single lock, and has 17 * no methods of its own. 18 */ 19public final class Lock { 20 private DbLock dbLock; 21 22 private Lock(final DbLock inLock) { 23 this.dbLock = inLock; 24 inLock.wrapper = this; 25 } 26 27 /* package */ 28 static Lock wrap(final DbLock dblock) { 29 return (dblock == null) ? null : new Lock(dblock); 30 } 31 32 /* package */ 33 DbLock unwrap() { 34 return dbLock; 35 } 36} 37