|
SolarMetric Kodo JDO 3.2.4 generated on January 7 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Handles obtaining and releasing locks on objects. The lock manager generally does not have to worry about synchronization, as the persistence manager is responsible for synchronizing the calls it makes to the lock manager.
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(KodoStateManager sm)
Return the lock level of the specified instance, or KodoPersistenceManager.LOCK_NONE if not locked. |
void |
lock(KodoStateManager sm,
int level,
int timeout,
Object context)
Obtain a lock on the specified object. |
void |
lockAll(Collection sms,
int level,
int timeout,
Object context)
Obtain locks on the specified objects. |
void |
release(KodoStateManager sm)
Release the lock on the given object. |
void |
setPersistenceManager(KodoPersistenceManager kpm)
Set the persistence manager this lock manager is associated with. |
Method Detail |
public void setPersistenceManager(KodoPersistenceManager kpm)
public int getLockLevel(KodoStateManager sm)
KodoPersistenceManager.LOCK_NONE
if not locked.public void lock(KodoStateManager sm, int level, int timeout, Object context)
sm
- the object to locklevel
- one of the lock constants defined in
KodoPersistenceManager
, or a custom leveltimeout
- the timeout in milliseconds, or a negative number for
no timeoutcontext
- the context information passed from the back end
store manager to the persistence manager, if any;
lock managers specific to a certain back end may be
able to take advantage of this; others should ignore itLockTimedOutException
- if a lock cannot be obtained in the
given number of millisecondsKodoStateManager.setLock(java.lang.Object)
public void lockAll(Collection sms, int level, int timeout, Object context)
lock(kodo.runtime.KodoStateManager, int, int, java.lang.Object)
public void release(KodoStateManager 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.KodoStateManager.setLock(java.lang.Object)
public void beginTransaction()
public void endTransaction()
public void close()
close
in interface com.solarmetric.util.Closeable
|
SolarMetric Kodo JDO 3.2.4 generated on January 7 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |