01: package org.apache.ojb.odmg.locking;
02:
03: /* Copyright 2002-2005 The Apache Software Foundation
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * 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;
22:
23: /**
24: * @deprecated
25: */
26: public interface LockMap extends Configurable {
27: /**
28: * returns the LockEntry for the Writer of object obj.
29: * If now writer exists, null is returned.
30: */
31: public LockEntry getWriter(Object obj);
32:
33: /**
34: * returns a collection of Reader LockEntries for object obj.
35: * If now LockEntries could be found an empty Vector is returned.
36: */
37: public Collection getReaders(Object obj);
38:
39: /**
40: * Add a reader lock entry for transaction tx on object obj
41: * to the persistent storage.
42: */
43: public boolean addReader(TransactionImpl tx, Object obj);
44:
45: /**
46: * remove a reader lock entry for transaction tx on object obj
47: * from the persistent storage.
48: */
49: public void removeReader(TransactionImpl tx, Object obj);
50:
51: /**
52: * remove a writer lock entry for transaction tx on object obj
53: * from the persistent storage.
54: */
55: public void removeWriter(LockEntry writer);
56:
57: /**
58: * upgrade a reader lock entry for transaction tx on object obj
59: * and write it to the persistent storage.
60: */
61: public boolean upgradeLock(LockEntry reader);
62:
63: /**
64: * generate a writer lock entry for transaction tx on object obj
65: * and write it to the persistent storage.
66: */
67: public boolean setWriter(TransactionImpl tx, Object obj);
68:
69: /**
70: * check if there is a reader lock entry for transaction tx on object obj
71: * in the persistent storage.
72: */
73: public boolean hasReadLock(TransactionImpl tx, Object obj);
74: }
|