|
40 | 40 | public @interface CircuitBreaker {
|
41 | 41 |
|
42 | 42 | /**
|
43 |
| - * Exception types that are retryable. Synonym for includes(). Defaults to empty (and |
44 |
| - * if excludes is also empty all exceptions are retried). |
| 43 | + * Exception types that are retryable. Defaults to empty (and if excludes is also |
| 44 | + * empty all exceptions are retried). |
45 | 45 | * @return exception types to retry
|
| 46 | + * @deprecated in favor of {@link #retryFor()} |
46 | 47 | */
|
| 48 | + @AliasFor(annotation = Retryable.class) |
| 49 | + @Deprecated |
47 | 50 | Class<? extends Throwable>[] value() default {};
|
48 | 51 |
|
49 | 52 | /**
|
|
52 | 55 | * @return exception types to retry
|
53 | 56 | * @deprecated in favor of {@link #retryFor()}.
|
54 | 57 | */
|
55 |
| - @AliasFor("retryFor") |
| 58 | + @AliasFor(annotation = Retryable.class) |
56 | 59 | @Deprecated
|
57 | 60 | Class<? extends Throwable>[] include() default {};
|
58 | 61 |
|
|
62 | 65 | * @return exception types to retry
|
63 | 66 | * @since 2.0
|
64 | 67 | */
|
65 |
| - @AliasFor("include") |
| 68 | + @AliasFor(annotation = Retryable.class) |
66 | 69 | Class<? extends Throwable>[] retryFor() default {};
|
67 | 70 |
|
68 | 71 | /**
|
|
73 | 76 | * @deprecated in favor of {@link #noRetryFor()}.
|
74 | 77 | */
|
75 | 78 | @Deprecated
|
76 |
| - @AliasFor("noRetryFor") |
| 79 | + @AliasFor(annotation = Retryable.class) |
77 | 80 | Class<? extends Throwable>[] exclude() default {};
|
78 | 81 |
|
79 | 82 | /**
|
|
83 | 86 | * @return exception types not to retry
|
84 | 87 | * @since 2.0
|
85 | 88 | */
|
86 |
| - @AliasFor("exclude") |
| 89 | + @AliasFor(annotation = Retryable.class) |
87 | 90 | Class<? extends Throwable>[] noRetryFor() default {};
|
88 | 91 |
|
89 | 92 | /**
|
|
93 | 96 | * @return exception types not to retry
|
94 | 97 | * @since 2.0
|
95 | 98 | */
|
| 99 | + @AliasFor(annotation = Retryable.class) |
96 | 100 | Class<? extends Throwable>[] notRecoverable() default {};
|
97 | 101 |
|
98 | 102 | /**
|
99 | 103 | * @return the maximum number of attempts (including the first failure), defaults to 3
|
100 | 104 | */
|
| 105 | + @AliasFor(annotation = Retryable.class) |
101 | 106 | int maxAttempts() default 3;
|
102 | 107 |
|
103 | 108 | /**
|
|
107 | 112 | * at runtime.
|
108 | 113 | * @since 1.2.3
|
109 | 114 | */
|
| 115 | + @AliasFor(annotation = Retryable.class) |
110 | 116 | String maxAttemptsExpression() default "";
|
111 | 117 |
|
112 | 118 | /**
|
113 | 119 | * A unique label for the circuit for reporting and state management. Defaults to the
|
114 | 120 | * method signature where the annotation is declared.
|
115 | 121 | * @return the label for the circuit
|
116 | 122 | */
|
| 123 | + @AliasFor(annotation = Retryable.class) |
117 | 124 | String label() default "";
|
118 | 125 |
|
119 | 126 | /**
|
|
137 | 144 | /**
|
138 | 145 | * When {@link #maxAttempts()} failures are reached within this timeout, the circuit
|
139 | 146 | * is opened automatically, preventing access to the downstream component.
|
140 |
| - * @return the timeout before an closed circuit is opened in milliseconds, defaults to |
| 147 | + * @return the timeout before a closed circuit is opened in milliseconds, defaults to |
141 | 148 | * 5000
|
142 | 149 | */
|
143 | 150 | long openTimeout() default 5000;
|
|
147 | 154 | * is opened automatically, preventing access to the downstream component. Overrides
|
148 | 155 | * {@link #openTimeout()}. Use {@code #{...}} for one-time evaluation during
|
149 | 156 | * initialization, omit the delimiters for evaluation at runtime.
|
150 |
| - * @return the timeout before an closed circuit is opened in milliseconds, no default. |
| 157 | + * @return the timeout before a closed circuit is opened in milliseconds, no default. |
151 | 158 | * @since 1.2.3
|
152 | 159 | */
|
153 | 160 | String openTimeoutExpression() default "";
|
|
171 | 178 | * @return the expression.
|
172 | 179 | * @since 1.2.3
|
173 | 180 | */
|
| 181 | + @AliasFor(annotation = Retryable.class) |
174 | 182 | String exceptionExpression() default "";
|
175 | 183 |
|
176 | 184 | }
|
0 commit comments