Package org.apache.openjpa.kernel
Class AbstractLockManager
- java.lang.Object
-
- org.apache.openjpa.kernel.AbstractLockManager
-
- All Implemented Interfaces:
LockLevels,LockManager,Closeable
- Direct Known Subclasses:
NoneLockManager,VersionLockManager
public abstract class AbstractLockManager extends Object implements LockManager
AbstractLockManagerimplementation.- Author:
- Marc Prud'hommeaux
-
-
Field Summary
Fields Modifier and Type Field Description protected StoreContextctxThe context against which this LockManager is operating.protected LoglogRuntime log to write locking messages to.-
Fields inherited from interface org.apache.openjpa.kernel.LockLevels
LOCK_NONE, LOCK_READ, LOCK_WRITE
-
-
Constructor Summary
Constructors Constructor Description AbstractLockManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginTransaction()Does nothing by default.voidclose()Does nothing by default.voidendTransaction()Does nothing by default.StoreContextgetContext()voidlockAll(Collection sms, int level, int timeout, Object context)Delegates toLockManager.lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object)with each element of the collectionvoidsetContext(StoreContext ctx)Set the context this lock manager is associated with.booleanskipRelationFieldLock()Default not to skip relation field to maintain PessimisticLockManager semantics.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.openjpa.kernel.LockManager
getLockLevel, lock, refreshLock, release
-
-
-
-
Field Detail
-
ctx
protected StoreContext ctx
The context against which this LockManager is operating.
-
log
protected Log log
Runtime log to write locking messages to.
-
-
Method Detail
-
setContext
public void setContext(StoreContext ctx)
Description copied from interface:LockManagerSet the context this lock manager is associated with. This will be invoked in the lock manager before any other methods are called.- Specified by:
setContextin interfaceLockManager
-
getContext
public StoreContext getContext()
-
lockAll
public void lockAll(Collection sms, int level, int timeout, Object context)
Delegates toLockManager.lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object)with each element of the collection- Specified by:
lockAllin interfaceLockManager- See Also:
LockManager.lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object)
-
beginTransaction
public void beginTransaction()
Does nothing by default.- Specified by:
beginTransactionin interfaceLockManager
-
endTransaction
public void endTransaction()
Does nothing by default.- Specified by:
endTransactionin interfaceLockManager
-
close
public void close()
Does nothing by default.- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceLockManager
-
skipRelationFieldLock
public boolean skipRelationFieldLock()
Default not to skip relation field to maintain PessimisticLockManager semantics.
-
-