public class InitializationLockHandler
extends java.lang.Object
implements java.io.Serializable
| Constructor and Description |
|---|
InitializationLockHandler(InitializationLockDao initializationDao) |
| Modifier and Type | Method and Description |
|---|---|
InitializationLockInfo |
getLockInfo()
Gives detailed init lock information.
|
boolean |
isLocked()
Tells whether init lock is being taken or not.
|
boolean |
lock(Tenant forTenant,
java.lang.String message)
Tries to acquires global lock.
|
boolean |
performLocked(Tenant forTenant,
java.util.concurrent.Callable<java.lang.Boolean> operation,
java.lang.String message)
Allows to performs some operation while holding the init lock.
|
void |
unlock(Tenant forTenant)
Releases acquired lock previously fetched via
lock(Tenant, String). |
public InitializationLockHandler(InitializationLockDao initializationDao)
public InitializationLockInfo getLockInfo()
public boolean isLocked()
public boolean performLocked(Tenant forTenant, java.util.concurrent.Callable<java.lang.Boolean> operation, java.lang.String message) throws java.lang.Exception
false if lock could not be acquired and operation was not performed, true if
lock had been acquired and operation had been performed.java.lang.Exception - from given operation Callablelock(Tenant, String),
unlock(Tenant)public boolean lock(Tenant forTenant, java.lang.String message)
unlock(Tenant) had been called.
Given message will be set as the purpose of lock it might be initialization/update of the platform.
Please note that a lock can only be acquired once, so also no other thread on the same cluster node will be able
to acquire it again!true if global lock had been taken, false otherwisepublic void unlock(Tenant forTenant)
lock(Tenant, String). Only the cluster node acquiring it is
able to do that!Copyright © 2018 SAP SE. All Rights Reserved.