KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > iapi > services > locks > VirtualLockTable


1 /*
2
3    Derby - Class org.apache.derby.iapi.services.locks.VirtualLockTable
4
5    Licensed to the Apache Software Foundation (ASF) under one or more
6    contributor license agreements. See the NOTICE file distributed with
7    this work for additional information regarding copyright ownership.
8    The ASF licenses this file to you under the Apache License, Version 2.0
9    (the "License"); you may not use this file except in compliance with
10    the License. You may obtain a copy of the License at
11
12       http://www.apache.org/licenses/LICENSE-2.0
13
14    Unless required by applicable law or agreed to in writing, software
15    distributed under the License is distributed on an "AS IS" BASIS,
16    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17    See the License for the specific language governing permissions and
18    limitations under the License.
19
20  */

21
22 package org.apache.derby.iapi.services.locks;
23
24 /**
25     This class acts as a conduit of information between the lock manager and
26     the outside world. Once a virtual lock table is initialized, it contains
27     a snap shot of all the locks currently held in the lock manager. A VTI can
28     then be written to query the content of the lock table.
29     <P>
30     Each lock held by the lock manager is represented by a Hashtable. The key
31     to each Hashtable entry is a lock attribute that is of interest to the
32     outside world, such as transaction id, type, mode, etc.
33  */

34
35 public interface VirtualLockTable {
36
37     // flags for Lockable.lockAttributes
38
public static final int LATCH = 1;
39     public static final int TABLE_AND_ROWLOCK = 2;
40     public static final int SHEXLOCK = 4;
41     public static final int ALL = ~0; // turn on all bits
42

43     // This is a list of attributes that is known to the Virtual Lock Table.
44

45     // list of attributes to be supplied by a participating Lockable
46
public static final String JavaDoc LOCKTYPE = "TYPE"; // mandatory
47
public static final String JavaDoc LOCKNAME = "LOCKNAME"; // mandatory
48
// either one of conglomId or containerId mandatory
49
public static final String JavaDoc CONGLOMID = "CONGLOMID";
50     public static final String JavaDoc CONTAINERID = "CONTAINERID";
51     public static final String JavaDoc SEGMENTID = "SEGMENTID"; // optional
52
public static final String JavaDoc PAGENUM = "PAGENUM"; // optional
53
public static final String JavaDoc RECID = "RECID"; // optional
54

55     // list of attributes added by the virtual lock table by asking
56
// the lock for its compatibility space and count
57
public static final String JavaDoc XACTID = "XID";
58     public static final String JavaDoc LOCKCOUNT = "LOCKCOUNT";
59
60     // list of attributes added by the virtual lock table by asking
61
// the lock qualifier
62
public static final String JavaDoc LOCKMODE = "MODE";
63
64     // list of attributes to be supplied the virtual lock table by looking at
65
// the lock table
66
public static final String JavaDoc STATE = "STATE";
67     public static final String JavaDoc LOCKOBJ = "LOCKOBJ";
68
69     // list of attributes filled in by virtual lock table with help from data
70
// dictionary
71
public static final String JavaDoc TABLENAME = "TABLENAME";
72     public static final String JavaDoc INDEXNAME = "INDEXNAME";
73     public static final String JavaDoc TABLETYPE = "TABLETYPE";
74
75 }
76
Popular Tags