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