OSDN Git Service

i
[luz/luz.git] / luz2 / src / com / lavans / luz2 / lremote / annotation / LRemote.java
1 /* $Id: LRemote.java 16 2008-12-02 09:31:01Z lavans $ */\r
2 package com.lavans.luz2.lremote.annotation;\r
3 \r
4 import java.lang.annotation.ElementType;\r
5 import java.lang.annotation.Retention;\r
6 import java.lang.annotation.RetentionPolicy;\r
7 import java.lang.annotation.Target;\r
8 \r
9 \r
10 @Target({ElementType.TYPE, ElementType.METHOD})\r
11 @Retention(RetentionPolicy.RUNTIME)\r
12 public @interface LRemote {\r
13         public static final String LOCAL="local";\r
14 \r
15         public enum Selector { ORDERED, ROUNDROBIN, GROUP, OTHERS };\r
16         /**\r
17          * Node group. Default is LOCAL.\r
18          * Set "local", the method is executed in local servlet container.\r
19          * Set groupname to execute the method in remote node.\r
20          * @return\r
21          */\r
22         String group() default LOCAL;\r
23 \r
24         /**\r
25          * Target node. Default is Target.ORDERED.\r
26          * <ul>Single connector\r
27          * <li>ORDERED</li>\r
28          * <li>ROUNDROBIN</li>\r
29          * </ul>\r
30          * <ul>Group connector\r
31          * <li>GROUP: execute in all node of group include itself.</li>\r
32          * <li>OTHERS: execute in all other node. Local server doesn't execute.</li>\r
33          * </ul>\r
34          *\r
35          * @return\r
36          */\r
37         Selector selector() default Selector.ORDERED;\r
38 \r
39         /**\r
40          * Synchronized flag. Default is true. For group connector only.\r
41          * If set <code>false</code>, connector does not wait for remote execution,\r
42          * and can't get any results. Logging is the only way for confirm method result.\r
43          * @return\r
44          */\r
45         boolean sync() default true;\r
46         \r
47 }\r