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 java.lang.Object implements LockManager
AbstractLockManager
implementation.- Author:
- Marc Prud'hommeaux
-
-
Field Summary
Fields Modifier and Type Field Description protected StoreContext
ctx
The context against which this LockManager is operating.protected Log
log
Runtime 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 void
beginTransaction()
Does nothing by default.void
close()
Does nothing by default.void
endTransaction()
Does nothing by default.StoreContext
getContext()
void
lockAll(java.util.Collection sms, int level, int timeout, java.lang.Object context)
Delegates toLockManager.lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object)
with each element of the collectionvoid
setContext(StoreContext ctx)
Set the context this lock manager is associated with.boolean
skipRelationFieldLock()
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:LockManager
Set the context this lock manager is associated with. This will be invoked in the lock manager before any other methods are called.- Specified by:
setContext
in interfaceLockManager
-
getContext
public StoreContext getContext()
-
lockAll
public void lockAll(java.util.Collection sms, int level, int timeout, java.lang.Object context)
Delegates toLockManager.lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object)
with each element of the collection- Specified by:
lockAll
in 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:
beginTransaction
in interfaceLockManager
-
endTransaction
public void endTransaction()
Does nothing by default.- Specified by:
endTransaction
in interfaceLockManager
-
close
public void close()
Does nothing by default.- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceLockManager
-
skipRelationFieldLock
public boolean skipRelationFieldLock()
Default not to skip relation field to maintain PessimisticLockManager semantics.
-
-