周浩 9 лет назад
Родитель
Сommit
f07d59d368

+ 20 - 0
hsweb-web-concurrent/hsweb-web-concurrent-lock/src/main/java/org/hsweb/concurrent/lock/annotation/Lock.java

@@ -0,0 +1,20 @@
+package org.hsweb.concurrent.lock.annotation;
+
+import java.lang.annotation.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by zhouhao on 16-5-13.
+ */
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface Lock {
+    String value() default "";
+
+    String condition() default "";
+
+    long waitTime() default Long.MAX_VALUE;
+
+    TimeUnit timeUnit() default TimeUnit.SECONDS;
+}

+ 20 - 0
hsweb-web-concurrent/hsweb-web-concurrent-lock/src/main/java/org/hsweb/concurrent/lock/annotation/ReadLock.java

@@ -0,0 +1,20 @@
+package org.hsweb.concurrent.lock.annotation;
+
+import java.lang.annotation.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by zhouhao on 16-5-13.
+ */
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface ReadLock {
+    String value() default "";
+
+    String condition() default "";
+
+    long waitTime() default Long.MAX_VALUE;
+
+    TimeUnit timeUnit() default TimeUnit.SECONDS;
+}

+ 20 - 0
hsweb-web-concurrent/hsweb-web-concurrent-lock/src/main/java/org/hsweb/concurrent/lock/annotation/WriteLock.java

@@ -0,0 +1,20 @@
+package org.hsweb.concurrent.lock.annotation;
+
+import java.lang.annotation.*;
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Created by zhouhao on 16-5-13.
+ */
+@Target({ElementType.METHOD})
+@Retention(RetentionPolicy.RUNTIME)
+@Documented
+public @interface WriteLock {
+    String value() default "";
+
+    String condition() default "";
+
+    long waitTime() default Long.MAX_VALUE;
+
+    TimeUnit timeUnit() default TimeUnit.SECONDS;
+}