Package com.logicaldoc.core.lock

# Class LockManager

java.lang.Object
com.logicaldoc.core.lock.LockManager

@Component("lockManager") public class LockManager extends Object
Central class to manage locks

Since:
  6.5
Author:
  Marco Meschieri - LogicalDOC

## Constructor Summary

Constructors
Constructor
Description
`LockManager()`

## Method Summary

Modifier and Type
Method
Description
`boolean`
`get(String lockName, String transactionId)`
Acquire a lock of a given name and for a given transaction.
`List<String>`
`getAllTransactions()`
Gets all the transaction ids associated to the locks
`void`
`release(String lockName, String transactionId)`
Releases a previously acquired lock.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### LockManager

public LockManager()

## Method Details

### getAllTransactions

public List<String> getAllTransactions()
Gets all the transaction ids associated to the locks

Returns:
  the lists of transactions

### get

public boolean get(String lockName, String transactionId)
Acquire a lock of a given name and for a given transaction.

Parameters:
  `lockName` - Name of the lock
  `transactionId` - Id of the transaction
Returns:
  true only if the lock was acquired

### release

public void release(String lockName, String transactionId) throws PersistenceException
Releases a previously acquired lock.

Parameters:
  `lockName` - The lock name
  `transactionId` - The transaction ID
Throws:
  `PersistenceException`