接口 SyncLock

所有已知实现类:
AbstractSyncLock, RedisSyncLock, RedisTemplateSyncLock

public interface SyncLock
分布式并发同步锁
从以下版本开始:
0.1.6
作者:
Troy
  • 方法详细资料

    • lock

      void lock(String name)
      获取锁
      参数:
      name - 锁名称
    • lock

      void lock(String name, int maxHoldSeconds)
      获取锁
      参数:
      name - 锁名称
      maxHoldSeconds - 锁最大持有时间
      从以下版本开始:
      0.3.2
    • lock

      void lock(String name, int maxHoldSeconds, int maxWaitSeconds)
      获取锁
      参数:
      name - 锁名称
      maxHoldSeconds - 持有锁最大时间
      maxWaitSeconds - 等待锁最大时间
      从以下版本开始:
      0.3.2
    • lock

      void lock(String name, String requestId)
      获取锁
      参数:
      name - 锁名称
      requestId - 请求者
    • lock

      void lock(String name, String requestId, int maxHoldSeconds)
      获取锁
      参数:
      name - 锁名称
      requestId - 请求者
      maxHoldSeconds - 锁最大持有时间
    • lock

      void lock(String name, String requestId, int maxHoldSeconds, int maxWaitSeconds)
      获取锁
      参数:
      name - 锁名称
      requestId - 请求者
      maxHoldSeconds - 持有锁最大时间
      maxWaitSeconds - 等待锁最大时间
    • release

      void release(String name)
      释放锁
      参数:
      name - 锁名称
    • release

      void release(String name, String requestId)
      释放锁
      参数:
      name - 锁名称
      requestId - 请求者
    • with

      void with(String name, Runnable run)
      在锁内运行
      参数:
      name - 锁名称
      run - 任务
      从以下版本开始:
      v0.4.9
    • with

      void with(String name, int maxHoldSeconds, Runnable run)
      在锁内运行
      参数:
      name - 锁名称
      maxHoldSeconds - 锁最大持有时间
      run - 任务
      从以下版本开始:
      v0.4.9
    • with

      void with(String name, int maxHoldSeconds, int maxWaitSeconds, Runnable run)
      在锁内运行
      参数:
      name - 锁名称
      maxHoldSeconds - 持有锁最大时间
      maxWaitSeconds - 等待锁最大时间
      run - 任务
      从以下版本开始:
      v0.4.9
    • with

      void with(String name, String requestId, Runnable run)
      在锁内运行
      参数:
      name - 锁名称
      requestId - 请求者
      run - 任务
      从以下版本开始:
      v0.4.9
    • with

      void with(String name, String requestId, int maxHoldSeconds, Runnable run)
      在锁内运行
      参数:
      name - 锁名称
      requestId - 请求者
      maxHoldSeconds - 锁最大持有时间
      run - 任务
      从以下版本开始:
      v0.4.9
    • with

      void with(String name, String requestId, int maxHoldSeconds, int maxWaitSeconds, Runnable run)
      在锁内运行
      参数:
      name - 锁名称
      requestId - 请求者
      maxHoldSeconds - 持有锁最大时间
      maxWaitSeconds - 等待锁最大时间
      run - 任务
      从以下版本开始:
      v0.4.9
    • run

      <V> V run(String name, Callable<V> run)
      在锁内运行
      参数:
      name - 锁名称
      run - 任务
      返回:
      the result of run
      从以下版本开始:
      v0.4.9
    • run

      <V> V run(String name, int maxHoldSeconds, Callable<V> run)
      在锁内运行
      参数:
      name - 锁名称
      maxHoldSeconds - 锁最大持有时间
      run - 任务
      返回:
      the result of run
      从以下版本开始:
      v0.4.9
    • run

      <V> V run(String name, int maxHoldSeconds, int maxWaitSeconds, Callable<V> run)
      在锁内运行
      参数:
      name - 锁名称
      maxHoldSeconds - 持有锁最大时间
      maxWaitSeconds - 等待锁最大时间
      run - 任务
      返回:
      the result of run
      从以下版本开始:
      v0.4.9, 0.3.2
    • run

      <V> V run(String name, String requestId, Callable<V> run)
      在锁内运行
      参数:
      name - 锁名称
      requestId - 请求者
      run - 任务
      返回:
      the result of run
      从以下版本开始:
      v0.4.9
    • run

      <V> V run(String name, String requestId, int maxHoldSeconds, Callable<V> run)
      在锁内运行
      参数:
      name - 锁名称
      requestId - 请求者
      maxHoldSeconds - 锁最大持有时间
      run - 任务
      返回:
      the result of run
      从以下版本开始:
      v0.4.9
    • run

      <V> V run(String name, String requestId, int maxHoldSeconds, int maxWaitSeconds, Callable<V> run)
      在锁内运行
      参数:
      name - 锁名称
      requestId - 请求者
      maxHoldSeconds - 持有锁最大时间
      maxWaitSeconds - 等待锁最大时间
      run - 任务
      返回:
      the result of run
      从以下版本开始:
      v0.4.9