@Component public class LockHelper extends Object
Identifier
のラッパー.修飾子とタイプ | フィールドと説明 |
---|---|
protected ContextHelper |
contextHelper
ContextHelper.
|
コンストラクタと説明 |
---|
LockHelper() |
修飾子とタイプ | メソッドと説明 |
---|---|
String |
concatTenantoId(String key)
指定文字列にテナントIDを付与して返却.
|
jp.co.intra_mart.foundation.service.client.information.NewLock |
makeInstance(String lockKey)
NewLock のインスタンスを生成. |
jp.co.intra_mart.foundation.service.client.information.NewLock |
makeInstance(String lockKey,
String tenantId)
NewLock のインスタンスを生成. |
jp.co.intra_mart.foundation.service.client.information.NewLock |
makeInstanceWithoutTenantId(String lockKey)
NewLock のインスタンスを生成. |
boolean |
tryLock(jp.co.intra_mart.foundation.service.client.information.NewLock lock)
NewLock.tryLock() を実行. |
boolean |
tryLock(jp.co.intra_mart.foundation.service.client.information.NewLock lock,
long timeoutSecond)
NewLock.tryLock(long, TimeUnit) を実行. |
void |
unlock(jp.co.intra_mart.foundation.service.client.information.NewLock lock)
NewLock.unlock() を実行. |
@Autowired protected ContextHelper contextHelper
public jp.co.intra_mart.foundation.service.client.information.NewLock makeInstance(String lockKey)
NewLock
のインスタンスを生成.
「ログインユーザのテナントID + "_" + lockKey」の形式でロックを取得します。
lockKey
- ロックキーpublic jp.co.intra_mart.foundation.service.client.information.NewLock makeInstance(String lockKey, String tenantId)
NewLock
のインスタンスを生成.
「tenantId + "_" + lockKey」の形式でロックを取得します。
lockKey
- ロックキーtenantId
- テナントIDpublic jp.co.intra_mart.foundation.service.client.information.NewLock makeInstanceWithoutTenantId(String lockKey)
NewLock
のインスタンスを生成.
テナントIDを付与せず、パラメータのlockKeyを利用してロックを取得します。
lockKey
- ロックキーpublic boolean tryLock(jp.co.intra_mart.foundation.service.client.information.NewLock lock)
NewLock.tryLock()
を実行.lock
- ロックオブジェクトpublic boolean tryLock(jp.co.intra_mart.foundation.service.client.information.NewLock lock, long timeoutSecond)
NewLock.tryLock(long, TimeUnit)
を実行.lock
- ロックオブジェクトtimeoutSecond
- 待機秒数public void unlock(jp.co.intra_mart.foundation.service.client.information.NewLock lock)
NewLock.unlock()
を実行.lock
- ロックオブジェクトCopyright © 2024 Sumitomo Life Information Systems Co., Ltd. All Rights Reserved.