Class DenormalisedLockService
- java.lang.Object
-
- com.atlassian.confluence.security.denormalisedpermissions.impl.manage.DenormalisedLockService
-
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean
public class DenormalisedLockService extends Object implements org.springframework.beans.factory.DisposableBean
Allows to acquire DB locks. Could be useful to prevent parallel execution.- Since:
- 7.11.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classDenormalisedLockService.LockName
-
Constructor Summary
Constructors Constructor Description DenormalisedLockService(com.atlassian.event.api.EventPublisher eventPublisher, org.hibernate.SessionFactory sessionFactory, org.springframework.transaction.PlatformTransactionManager transactionManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidacquireLockForTransaction(DenormalisedLockService.LockName lockName)Acquires the lock.voiddestroy()DenormalisedLockgetRecord(DenormalisedLockService.LockName lockName)voidinit()voidonApplicationStarted(com.atlassian.config.lifecycle.events.ApplicationStartedEvent applicationStartedEvent)
-
-
-
Method Detail
-
init
@PostConstruct public void init()
-
acquireLockForTransaction
public void acquireLockForTransaction(DenormalisedLockService.LockName lockName)
Acquires the lock. Must be called from an existing transaction. Released automatically when the transaction finishes- Parameters:
lockName- the name of the lock
-
getRecord
public DenormalisedLock getRecord(DenormalisedLockService.LockName lockName)
-
onApplicationStarted
@EventListener public void onApplicationStarted(com.atlassian.config.lifecycle.events.ApplicationStartedEvent applicationStartedEvent)
-
-