All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jiangkedev.lock.AbstractDistributedLock Maven / Gradle / Ivy

The newest version!
package com.jiangkedev.lock;

/**
 * @author jiangke
 * @date 22:25
 */
public abstract class AbstractDistributedLock implements DistributedLock {
    @Override
    public boolean lock(String key) {
        return lock(key, TIMEOUT_MILLIS, RETRY_TIMES, SLEEP_MILLIS);
    }

    @Override
    public boolean lock(String key, int retryTimes) {
        return lock(key, TIMEOUT_MILLIS, retryTimes, SLEEP_MILLIS);
    }

    @Override
    public boolean lock(String key, int retryTimes, long sleepMillis) {
        return lock(key, TIMEOUT_MILLIS, retryTimes, sleepMillis);
    }

    @Override
    public boolean lock(String key, long expire) {
        return lock(key, expire, RETRY_TIMES, SLEEP_MILLIS);
    }

    @Override
    public boolean lock(String key, long expire, int retryTimes) {
        return lock(key, expire, retryTimes, SLEEP_MILLIS);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy