KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > derby > impl > store > raw > xact > NoLocking


1 /*
2
3    Derby - Class org.apache.derby.impl.store.raw.xact.NoLocking
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.impl.store.raw.xact;
23
24 import org.apache.derby.iapi.services.locks.Latch;
25
26 import org.apache.derby.iapi.store.raw.LockingPolicy;
27 import org.apache.derby.iapi.store.raw.ContainerHandle;
28 import org.apache.derby.iapi.store.raw.RecordHandle;
29 import org.apache.derby.iapi.store.raw.Transaction;
30
31 import org.apache.derby.iapi.error.StandardException;
32
33
34 /**
35     A locking policy that implements no locking.
36
37     @see LockingPolicy
38 */

39 class NoLocking implements LockingPolicy {
40
41     protected NoLocking() {
42     }
43
44     public boolean lockContainer(
45     Transaction t,
46     ContainerHandle container,
47     boolean waitForLock,
48     boolean forUpdate)
49         throws StandardException {
50         return true;
51     }
52
53     public void unlockContainer(
54     Transaction t,
55     ContainerHandle container)
56     {
57     }
58
59     public boolean lockRecordForRead(
60     Transaction t,
61     ContainerHandle container,
62     RecordHandle record,
63     boolean waitForLock,
64     boolean forUpdate)
65         throws StandardException
66     {
67         return true;
68     }
69
70     public void lockRecordForRead(
71     Latch latch,
72     RecordHandle record,
73     boolean forUpdate)
74         throws StandardException
75     {
76     }
77
78     public boolean zeroDurationLockRecordForWrite(
79     Transaction t,
80     RecordHandle record,
81     boolean lockForPreviousKey,
82     boolean waitForLock)
83         throws StandardException
84     {
85         return true;
86     }
87
88     public boolean lockRecordForWrite(
89     Transaction t,
90     RecordHandle record,
91     boolean lockForInsert,
92     boolean waitForLock)
93         throws StandardException
94     {
95         return true;
96     }
97
98     public void lockRecordForWrite(
99     Latch latch,
100     RecordHandle record)
101         throws StandardException
102     {
103     }
104
105     public void unlockRecordAfterRead(
106     Transaction t,
107     ContainerHandle container,
108     RecordHandle record,
109     boolean forUpdate,
110     boolean row_qualified)
111         throws StandardException
112     {
113     }
114
115     public int getMode() {
116         return LockingPolicy.MODE_NONE;
117     }
118
119 }
120
Popular Tags