001 package org.apache.ojb.odmg.locking;
002
003 /* Copyright 2002-2005 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018 import org.apache.ojb.broker.util.configuration.Configurable;
019 import org.apache.ojb.odmg.TransactionImpl;
020
021 import java.util.Collection;
022
023 /**
024 * @deprecated
025 */
026 public interface LockMap extends Configurable
027 {
028 /**
029 * returns the LockEntry for the Writer of object obj.
030 * If now writer exists, null is returned.
031 */
032 public LockEntry getWriter(Object obj);
033
034 /**
035 * returns a collection of Reader LockEntries for object obj.
036 * If now LockEntries could be found an empty Vector is returned.
037 */
038 public Collection getReaders(Object obj);
039
040 /**
041 * Add a reader lock entry for transaction tx on object obj
042 * to the persistent storage.
043 */
044 public boolean addReader(TransactionImpl tx, Object obj);
045
046 /**
047 * remove a reader lock entry for transaction tx on object obj
048 * from the persistent storage.
049 */
050 public void removeReader(TransactionImpl tx, Object obj);
051
052 /**
053 * remove a writer lock entry for transaction tx on object obj
054 * from the persistent storage.
055 */
056 public void removeWriter(LockEntry writer);
057
058 /**
059 * upgrade a reader lock entry for transaction tx on object obj
060 * and write it to the persistent storage.
061 */
062 public boolean upgradeLock(LockEntry reader);
063
064 /**
065 * generate a writer lock entry for transaction tx on object obj
066 * and write it to the persistent storage.
067 */
068 public boolean setWriter(TransactionImpl tx, Object obj);
069
070 /**
071 * check if there is a reader lock entry for transaction tx on object obj
072 * in the persistent storage.
073 */
074 public boolean hasReadLock(TransactionImpl tx, Object obj);
075 }