|
@@ -1,13 +1,9 @@
|
|
|
package com.mrxu.framework.starter.redisson.anno;
|
|
package com.mrxu.framework.starter.redisson.anno;
|
|
|
|
|
|
|
|
-import java.lang.annotation.Documented;
|
|
|
|
|
-import java.lang.annotation.ElementType;
|
|
|
|
|
-import java.lang.annotation.Retention;
|
|
|
|
|
-import java.lang.annotation.RetentionPolicy;
|
|
|
|
|
-import java.lang.annotation.Target;
|
|
|
|
|
-
|
|
|
|
|
import com.mrxu.framework.starter.redisson.bean.LockPolicy;
|
|
import com.mrxu.framework.starter.redisson.bean.LockPolicy;
|
|
|
|
|
|
|
|
|
|
+import java.lang.annotation.*;
|
|
|
|
|
+
|
|
|
@Target({ElementType.METHOD})
|
|
@Target({ElementType.METHOD})
|
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
|
@Documented
|
|
@Documented
|
|
@@ -16,7 +12,7 @@ public @interface Lock {
|
|
|
/**
|
|
/**
|
|
|
* 锁的策略
|
|
* 锁的策略
|
|
|
*/
|
|
*/
|
|
|
- LockPolicy policy() default LockPolicy.Lock;
|
|
|
|
|
|
|
+ LockPolicy policy() default LockPolicy.SpinLock;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 锁持续时间 单位秒 默认1分钟
|
|
* 锁持续时间 单位秒 默认1分钟
|
|
@@ -26,7 +22,7 @@ public @interface Lock {
|
|
|
/**
|
|
/**
|
|
|
* 自旋锁超时时间 单位毫秒
|
|
* 自旋锁超时时间 单位毫秒
|
|
|
*/
|
|
*/
|
|
|
- long waitTime() default 300L;
|
|
|
|
|
|
|
+ long waitTime() default 2000L;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* redis锁的key前缀 如果为空,则默认为类名+方法名
|
|
* redis锁的key前缀 如果为空,则默认为类名+方法名
|