Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.transaction.locking
Interface LockManager

All Known Implementing Classes:
  GenericLockManager

public interface LockManager

A manager for multi level locks on resources. Encapsulates creation, removal, and retrieval of locks. Each resource can have at most a single lock. However, it may be possible for more than one accessing entity to have influence on this lock via different lock levels that may be provided by the according implementation of `MultiLevelLock`.

Version:
  $Revision$
See Also:
  `MultiLevelLock`

Method Summary
`MultiLevelLock` | `atomicGetOrCreateLock(Object resourceId)` Either gets an existing lock on the specified resource or creates one if none exists.
`MultiLevelLock` | `getLock(Object resourceId)` Gets an existing lock on the specified resource.
`void` | `removeLock(MultiLevelLock lock)` Removes the specified lock from the associated resource.

Method Detail

### atomicGetOrCreateLock

    public MultiLevelLock atomicGetOrCreateLock(Object resourceId)

  Either gets an existing lock on the specified resource or creates one if none exists. This methods guarantees to do this atomically.

  Parameters:
    `resourceId` - the resource to get or create the lock on
  Returns:
    the lock for the specified resource

### getLock

    public MultiLevelLock getLock(Object resourceId)

  Gets an existing lock on the specified resource. If none exists it returns `null`.

  Parameters:
    `resourceId` - the resource to get the lock for
  Returns:
    the lock on the specified resource

### removeLock

    public void removeLock(MultiLevelLock lock)

  Removes the specified lock from the associated resource.

  Parameters:
    `lock` - the lock to be removed

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 The Apache Software Foundation. All Rights Reserved.