KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > odmg > locking > LockMap


1 package org.apache.ojb.odmg.locking;
2
3 /* Copyright 2002-2005 The Apache Software Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */

17
18 import org.apache.ojb.broker.util.configuration.Configurable;
19 import org.apache.ojb.odmg.TransactionImpl;
20
21 import java.util.Collection JavaDoc;
22
23 /**
24  * @deprecated
25  */

26 public interface LockMap extends Configurable
27 {
28     /**
29      * returns the LockEntry for the Writer of object obj.
30      * If now writer exists, null is returned.
31      */

32     public LockEntry getWriter(Object JavaDoc obj);
33
34     /**
35      * returns a collection of Reader LockEntries for object obj.
36      * If now LockEntries could be found an empty Vector is returned.
37      */

38     public Collection JavaDoc getReaders(Object JavaDoc obj);
39
40     /**
41      * Add a reader lock entry for transaction tx on object obj
42      * to the persistent storage.
43      */

44     public boolean addReader(TransactionImpl tx, Object JavaDoc obj);
45
46     /**
47      * remove a reader lock entry for transaction tx on object obj
48      * from the persistent storage.
49      */

50     public void removeReader(TransactionImpl tx, Object JavaDoc obj);
51
52     /**
53      * remove a writer lock entry for transaction tx on object obj
54      * from the persistent storage.
55      */

56     public void removeWriter(LockEntry writer);
57
58     /**
59      * upgrade a reader lock entry for transaction tx on object obj
60      * and write it to the persistent storage.
61      */

62     public boolean upgradeLock(LockEntry reader);
63
64     /**
65      * generate a writer lock entry for transaction tx on object obj
66      * and write it to the persistent storage.
67      */

68     public boolean setWriter(TransactionImpl tx, Object JavaDoc obj);
69
70     /**
71      * check if there is a reader lock entry for transaction tx on object obj
72      * in the persistent storage.
73      */

74     public boolean hasReadLock(TransactionImpl tx, Object JavaDoc obj);
75 }
76
Popular Tags