Package de.hybris.platform.core.system
Class InitializationLockHandler
java.lang.Object
de.hybris.platform.core.system.InitializationLockHandler
- All Implemented Interfaces:
Serializable
Global initialization locking handler.
By now locking happens using one table inside the master tenant database containing one row that holds the current global initialization locking status.
This has some consequences:
- only one instance if able to acquire that lock
- only one tenant at a time may be initialized
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGives detailed init lock information.booleanisLocked()Tells whether init lock is being taken or not.booleanTries to acquires global lock.booleanperformLocked(Tenant forTenant, Callable<Boolean> operation, String message) Allows to performs some operation while holding the init lock.voidReleases acquired lock previously fetched vialock(Tenant, String).
-
Constructor Details
-
InitializationLockHandler
-
-
Method Details
-
getLockInfo
Gives detailed init lock information. -
isLocked
public boolean isLocked()Tells whether init lock is being taken or not. -
performLocked
public boolean performLocked(Tenant forTenant, Callable<Boolean> operation, String message) throws Exception Allows to performs some operation while holding the init lock. After successful acquiring of the lock the operation is being performed and finally the lock is being released. -
lock
Tries to acquires global lock. After this call no other cluster node will be able to acquire it untilunlock(Tenant)had been called.Given
messagewill 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!
- Returns:
trueif global lock had been taken,falseotherwise
-
unlock
Releases acquired lock previously fetched vialock(Tenant, String). Only the cluster node acquiring it is able to do that!
-