org.priha.core.locks
Class LockManager

java.lang.Object
  extended by org.priha.core.locks.LockManager

public class LockManager
extends java.lang.Object

A LockManager exists per static workspace. This means that it manages *all* the locks for a given workspace, regardless of the Session which accesses it.


Method Summary
 void addLock(QLock lock)
           
 void expireSessionLocks(SessionImpl session)
           
 QLock findLock(Path path)
          Checks if the object at this path or any object above it holds a lock.
static LockManager getInstance(WorkspaceImpl ws)
          This method must be used to access a LockManager.
 QLock getLock(Path path)
          Checks if the object at this path holds a lock.
 boolean hasChildLock(Path internalPath)
          Checks if any of the children of this Node hold a lock to which the session does not hold a key to.
 void moveLock(QLock lock, Path destPath)
          Updates a lock with a new path.
 void removeLock(QLock lock)
          Removes the lock, if it exists.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addLock

public void addLock(QLock lock)

getLock

public QLock getLock(Path path)
Checks if the object at this path holds a lock.

Parameters:
path -
Returns:

findLock

public QLock findLock(Path path)
Checks if the object at this path or any object above it holds a lock.

Parameters:
path -
Returns:

getInstance

public static LockManager getInstance(WorkspaceImpl ws)
This method must be used to access a LockManager.

Parameters:
ws -
Returns:

expireSessionLocks

public void expireSessionLocks(SessionImpl session)

moveLock

public void moveLock(QLock lock,
                     Path destPath)
Updates a lock with a new path.

Parameters:
lock - Lock to change.
destPath - New path.

removeLock

public void removeLock(QLock lock)
Removes the lock, if it exists.

Parameters:
lock - Lock to remove.

hasChildLock

public boolean hasChildLock(Path internalPath)
Checks if any of the children of this Node hold a lock to which the session does not hold a key to.

Parameters:
internalPath -
Returns: