org.apache.openjpa.kernel
Class AbstractLockManager

java.lang.Object
  extended by org.apache.openjpa.kernel.AbstractLockManager
All Implemented Interfaces:
LockLevels, LockManager, Closeable
Direct Known Subclasses:
NoneLockManager, VersionLockManager

public abstract class AbstractLockManager
extends Object
implements LockManager

Abstract LockManager implementation.

Author:
Marc Prud'hommeaux

Field Summary
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
AbstractLockManager()
           
 
Method Summary
 void beginTransaction()
          Does nothing by default.
 void close()
          Does nothing by default.
 void endTransaction()
          Does nothing by default.
 StoreContext getContext()
           
 void lockAll(Collection sms, int level, int timeout, Object context)
          Delegates to LockManager.lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object) with each element of the collection
 void setContext(StoreContext ctx)
          Set the context this lock manager is associated with.
 
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, 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.

Constructor Detail

AbstractLockManager

public AbstractLockManager()
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 interface LockManager

getContext

public StoreContext getContext()

lockAll

public void lockAll(Collection sms,
                    int level,
                    int timeout,
                    Object context)
Delegates to LockManager.lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object) with each element of the collection

Specified by:
lockAll in interface LockManager
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 interface LockManager

endTransaction

public void endTransaction()
Does nothing by default.

Specified by:
endTransaction in interface LockManager

close

public void close()
Does nothing by default.

Specified by:
close in interface LockManager
Specified by:
close in interface Closeable


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.