org.apache.commons.transaction.locking
Interface HierarchicalLockManager<K,M>
- All Superinterfaces:
- LockManager<K,M>
- All Known Implementing Classes:
- DefaultHierarchicalLockManager
public interface HierarchicalLockManager<K,M>
- extends LockManager<K,M>
Interface to manage locks on hierarchically organized resources.
Instead of a single key specifying a resource this manager expects a complete
path to it. This path can be used to perform a number of lock requests to
ensure the resource is properly locked inside the hierarchy. Which lock
requests are performed is determined by the specific implementation.
- See Also:
DefaultHierarchicalLockManager
|
Method Summary |
void |
lockInHierarchy(M resourceManager,
String path,
boolean exclusive)
Locks a specific resource denoted by a resource manager it holds and a
path. |
lockInHierarchy
void lockInHierarchy(M resourceManager,
String path,
boolean exclusive)
throws LockException
- Locks a specific resource denoted by a resource manager it holds and a
path. This requests ensures that the resource is properly locked in its
hierarchy, possibly by issuing a number of additional lock requests.
- Parameters:
resourceManager - resource manager that tries to acquire a lockpath - the complete path to the resource to be lockedexclusive - true if this lock shall be acquired in
exclusive mode, false if it can be shared by
other threads
- Throws:
LockException - if the lock could not be acquired, possibly because of a
timeout or a deadlock
Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.