Line | |
---|
1 | package omq.client.annotation; |
---|
2 | |
---|
3 | import java.lang.annotation.ElementType; |
---|
4 | import java.lang.annotation.Retention; |
---|
5 | import java.lang.annotation.RetentionPolicy; |
---|
6 | import java.lang.annotation.Target; |
---|
7 | |
---|
8 | /** |
---|
9 | * Annotation which indicates a method as Synchronous. It can have two |
---|
10 | * parameters: timeout and retry which will give you how long you have to wait a |
---|
11 | * synchronous method and how many times you'll wait for the response. |
---|
12 | * |
---|
13 | * @author Sergi Toda <sergi.toda@estudiants.urv.cat> |
---|
14 | * |
---|
15 | */ |
---|
16 | @Retention(RetentionPolicy.RUNTIME) |
---|
17 | @Target(ElementType.METHOD) |
---|
18 | public @interface SyncMethod { |
---|
19 | /** |
---|
20 | * Timeout of a synchronous method |
---|
21 | * |
---|
22 | * @return how long we'll wait for a response |
---|
23 | */ |
---|
24 | long timeout() default 60000L; |
---|
25 | |
---|
26 | /** |
---|
27 | * Number of retries of a synchronous method |
---|
28 | * |
---|
29 | * @return how many retries we'll make. If the timeout is set, every timeout |
---|
30 | * will use it |
---|
31 | */ |
---|
32 | int retry() default 1; |
---|
33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.