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

com.luues.redis.single.lock.RedisSynchronized Maven / Gradle / Ivy

There is a newer version: 2.0.1.RELEASE
Show newest version
package com.luues.redis.single.lock;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE, ElementType.METHOD, ElementType.ANNOTATION_TYPE})
public @interface RedisSynchronized {
    String key() default "";
    int time() default 0; //默认0,按照顺序依次执行 if > 0,该时间段内请求会返回 您的手速太快了,请稍后再试
    int lockWaitTime() default 0; //获取锁等待时间,默认0,不等待,获取失败直接返回错误信息  if < 0,一直等待,直至锁获取成功  if > 0,指定时间内未返回错误信息
    int lockExpireTime() default 60; //持有锁时长,默认5秒,根据业务执行时间自行设置(建议该值大于实际执行时间),执行成功会自动释放锁
    String condition() default "";   //el表达式,满足该条件才加锁
    String message() default ""; //返回错误提示语
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy