01: /*-
02: * See the file LICENSE for redistribution information.
03: *
04: * Copyright (c) 2002,2008 Oracle. All rights reserved.
05: *
06: * $Id: LockGrantType.java,v 1.18.2.2 2008/01/07 15:14:17 cwl Exp $
07: */
08:
09: package com.sleepycat.je.txn;
10:
11: /**
12: * LockGrantType is an enumeration of the possible results of a lock attempt.
13: */
14: public class LockGrantType {
15: private String name;
16:
17: /* Grant types */
18: public static final LockGrantType NEW = new LockGrantType("NEW");
19: public static final LockGrantType WAIT_NEW = new LockGrantType(
20: "WAIT_NEW");
21: public static final LockGrantType PROMOTION = new LockGrantType(
22: "PROMOTION");
23: public static final LockGrantType WAIT_PROMOTION = new LockGrantType(
24: "WAIT_PROMOTION");
25: public static final LockGrantType EXISTING = new LockGrantType(
26: "EXISTING");
27: public static final LockGrantType DENIED = new LockGrantType(
28: "DENIED");
29: public static final LockGrantType WAIT_RESTART = new LockGrantType(
30: "WAIT_RESTART");
31: public static final LockGrantType NONE_NEEDED = new LockGrantType(
32: "NONE_NEEDED");
33:
34: /* No lock types can be defined outside this class */
35: private LockGrantType(String name) {
36: this .name = name;
37: }
38:
39: public String toString() {
40: return name;
41: }
42: }
|