1 package org.apache.ojb.broker.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 19 /** 20 * This interface defines method that a Locking Strategy must implement 21 * according to the isolation level it represents. 22 */ 23 abstract class LockIsolation 24 { 25 /** 26 * Returns the isolation level identity. 27 * @return The isolation level number. 28 */ 29 abstract int getIsolationLevel(); 30 31 /** 32 * Returns the isolation level identity as string. 33 * @return The isolation level as string. 34 */ 35 abstract String getIsolationLevelAsString(); 36 37 /** 38 * Decide if this lock strategy allows multiple read locks. 39 * 40 * @return <em>True</em> if multiple read locks allowed, else <em>False</em>. 41 */ 42 abstract boolean allowMultipleRead(); 43 44 /** 45 * Decide if this lock strategy allows a write lock when one or more read 46 * locks already exists. 47 * 48 * @return <em>True</em> if write lock allowed when read lock exist, else <em>False</em>. 49 */ 50 abstract boolean allowWriteWhenRead(); 51 52 /** 53 * Decide if this lock strategy allows one or more read locks when a write 54 * lock already exists. 55 * 56 * @return <em>True</em> if read locks allowed when write lock exist, else <em>False</em>. 57 */ 58 abstract boolean allowReadWhenWrite(); 59 } 60