public class LockManager extends Object
The public methods called by the session are setLock(java.io.Serializable, org.nuxeo.ecm.core.api.Lock)
,
removeLock(java.io.Serializable, java.lang.String)
and getLock(java.io.Serializable)
. Method shutdown()
must be
called when done with the lock manager.
In cluster mode, changes are executed in a begin/commit so that tests/updates can be atomic.
Transaction management can be done by hand because we're dealing with a
low-level Mapper
and not something wrapped by a JCA pool.
Constructor and Description |
---|
LockManager(Mapper mapper,
boolean clusteringEnabled)
Creates a lock manager using the given mapper.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canLockBeRemoved(Lock lock,
String owner)
Checks if a given lock can be removed by the given owner.
|
void |
clearCaches() |
Lock |
getLock(Serializable id)
Gets the lock on a document.
|
Lock |
removeLock(Serializable id,
String owner)
Unlocks a document.
|
Lock |
setLock(Serializable id,
Lock lock)
Locks a document.
|
void |
shutdown()
Shuts down the lock manager.
|
String |
toString() |
public LockManager(Mapper mapper, boolean clusteringEnabled) throws StorageException
The mapper will from then on be only used and closed by the lock manager.
shutdown()
must be called when done with the lock manager.
StorageException
public void shutdown() throws StorageException
StorageException
public Lock getLock(Serializable id) throws StorageException
StorageException
public Lock setLock(Serializable id, Lock lock) throws StorageException
StorageException
public Lock removeLock(Serializable id, String owner) throws StorageException
StorageException
public void clearCaches()
Copyright © 2013 Nuxeo SA. All Rights Reserved.