Imported Upstream version 5.3.21
[platform/upstream/libdb.git] / lang / java / src / com / sleepycat / db / Lock.java
1 /*-
2  * See the file LICENSE for redistribution information.
3  *
4  * Copyright (c) 2001, 2012 Oracle and/or its affiliates.  All rights reserved.
5  *
6  * $Id$
7  */
8
9 package com.sleepycat.db;
10
11 import 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  */
19 public 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 }