
cn.echo.distribution.lock.annotation.DistributionLock Maven / Gradle / Ivy
package cn.echo.distribution.lock.annotation;
import java.lang.annotation.*;
/**
* 分布式锁
*/
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Inherited
public @interface DistributionLock {
/**
* 锁名称
*/
String value() default "";
/**
* 持锁时间,持锁超过此时间自动丢弃锁
* 单位毫秒,默认30秒
*/
long keepMills() default 30 * 1000;
/**
* 最大取锁等待时间
* 没有获取到锁的情况下继续等待,如果超时抛出TimeoutException
* 单位毫秒,默认1秒
*/
long maxWaitMills() default 1 * 1000;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy