|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LockManager
Handles obtaining and releasing locks on objects. The lock manager generally does not have to worry about synchronization, as the context is responsible for synchronizing the calls it makes to the lock manager.
Field Summary |
---|
Fields inherited from interface org.apache.openjpa.kernel.LockLevels |
---|
LOCK_NONE, LOCK_READ, LOCK_WRITE |
Method Summary | |
---|---|
void |
beginTransaction()
Notification that a transaction is beginning. |
void |
close()
Free any resources. |
void |
endTransaction()
Notification that the current transaction has ended. |
int |
getLockLevel(OpenJPAStateManager sm)
Return the lock level of the specified instance, or LockLevels.LOCK_NONE if not locked. |
void |
lock(OpenJPAStateManager sm,
int level,
int timeout,
Object sdata)
Obtain a lock on the specified object. |
void |
lockAll(Collection sms,
int level,
int timeout,
Object sdata)
Obtain locks on the specified objects. |
void |
release(OpenJPAStateManager sm)
Release the lock on the given object. |
void |
setContext(StoreContext ctx)
Set the context this lock manager is associated with. |
Method Detail |
---|
void setContext(StoreContext ctx)
int getLockLevel(OpenJPAStateManager sm)
LockLevels.LOCK_NONE
if not locked.
void lock(OpenJPAStateManager sm, int level, int timeout, Object sdata)
sm
- the object to locklevel
- one of the lock constants defined in LockLevels
,
or a custom leveltimeout
- the timeout in milliseconds, or a negative number for
no timeoutsdata
- the context information passed from the store manager
to the persistence context, if any; lock managers
specific to a certain back end may be able to take
advantage of this; others should ignore it
LockException
- if a lock cannot be
obtained in the given number of millisecondsOpenJPAStateManager.setLock(java.lang.Object)
void lockAll(Collection sms, int level, int timeout, Object sdata)
lock(org.apache.openjpa.kernel.OpenJPAStateManager, int, int, java.lang.Object)
void release(OpenJPAStateManager sm)
endTransaction()
.
The lock manager should null the state manager's lock object. Note
that some state manager may be garbage collected during a transaction;
thus lock managers cannot rely on this method being called for every
state manager.
OpenJPAStateManager.setLock(java.lang.Object)
void beginTransaction()
void endTransaction()
void close()
close
in interface Closeable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |