Class DefaultInitLockDao
- java.lang.Object
-
- de.hybris.platform.core.system.impl.DefaultInitLockDao
-
- All Implemented Interfaces:
InitializationLockDao,java.io.Serializable
public class DefaultInitLockDao extends java.lang.Object implements InitializationLockDao
Implementation of theInitializationLockDao.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DefaultInitLockDao()DefaultInitLockDao(QueryProvider queryProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateTable()Optionally creates table.protected HybrisDataSourcegetInitializedMasterDataSource()Method reinitializes a instance property to most accurate, so as a result we would have always an openHybrisDataSourceif possible.longgetUniqueInstanceIdentifier()Identifier specific for running platform.booleaninsertRow()Optionally inserts lock row.booleanlockRow(Tenant forTenant, java.lang.String processName)Locks row using cluster node ID from given tenant.InitializationLockInforeadLockInfo()Reads current locking information.booleanreleaseRow(Tenant forTenant)Releases existing lock.
-
-
-
Constructor Detail
-
DefaultInitLockDao
public DefaultInitLockDao()
-
DefaultInitLockDao
public DefaultInitLockDao(QueryProvider queryProvider)
-
-
Method Detail
-
getInitializedMasterDataSource
protected HybrisDataSource getInitializedMasterDataSource()
Method reinitializes a instance property to most accurate, so as a result we would have always an openHybrisDataSourceif possible.
-
readLockInfo
public InitializationLockInfo readLockInfo()
Description copied from interface:InitializationLockDaoReads current locking information.- Specified by:
readLockInfoin interfaceInitializationLockDao- Returns:
nullif no lock row or table exists, the info object otherwise
-
lockRow
public boolean lockRow(Tenant forTenant, java.lang.String processName)
Description copied from interface:InitializationLockDaoLocks row using cluster node ID from given tenant. Requires lock not being taken before (no matter by which cluster node!).- Specified by:
lockRowin interfaceInitializationLockDao
-
releaseRow
public boolean releaseRow(Tenant forTenant)
Description copied from interface:InitializationLockDaoReleases existing lock. Tenant must have cluster node ID that matches the one inside the lock!- Specified by:
releaseRowin interfaceInitializationLockDao
-
insertRow
public boolean insertRow()
Description copied from interface:InitializationLockDaoOptionally inserts lock row.- Specified by:
insertRowin interfaceInitializationLockDao- Returns:
trueif row could be inserted or row already exists,falseon other errors (e.g. table not existing)
-
createTable
public void createTable()
Description copied from interface:InitializationLockDaoOptionally creates table. If table already exists it does nothing.- Specified by:
createTablein interfaceInitializationLockDao
-
getUniqueInstanceIdentifier
public long getUniqueInstanceIdentifier()
Description copied from interface:InitializationLockDaoIdentifier specific for running platform. Every platform startup standalone or other should have own unique identifier.- Specified by:
getUniqueInstanceIdentifierin interfaceInitializationLockDao
-
-