@@ -46,6 +46,18 @@ public abstract class InterceptorUtils {
46
46
47
47
public static final Class <? extends Annotation > INTERCEPTOR_ANNOTATION_TYPE = javax .interceptor .Interceptor .class ;
48
48
49
+ public static final Class <? extends Annotation > INTERCEPTOR_BINDING_ANNOTATION_TYPE = InterceptorBinding .class ;
50
+
51
+ public static final Class <? extends Annotation > AROUND_INVOKE_ANNOTATION_TYPE = AroundInvoke .class ;
52
+
53
+ public static final Class <? extends Annotation > AROUND_TIMEOUT_ANNOTATION_TYPE = AroundTimeout .class ;
54
+
55
+ public static final Class <? extends Annotation > AROUND_CONSTRUCT_ANNOTATION_TYPE = AroundConstruct .class ;
56
+
57
+ public static final Class <? extends Annotation > POST_CONSTRUCT_ANNOTATION_TYPE = PostConstruct .class ;
58
+
59
+ public static final Class <? extends Annotation > PRE_DESTROY_ANNOTATION_TYPE = PreDestroy .class ;
60
+
49
61
50
62
public static boolean isInterceptorClass (Class <?> interceptorClass ) {
51
63
if (isAnnotationPresent (interceptorClass , INTERCEPTOR_ANNOTATION_TYPE )) {
@@ -105,7 +117,7 @@ public static <A extends Annotation> A searchAnnotation(Class<?> componentClass,
105
117
* or if the return type of method is not <code>Object</code> or its derived type.
106
118
*/
107
119
public static boolean isAroundInvokeMethod (Method method ) {
108
- return isInterceptionMethod (method , AroundInvoke . class , Object .class );
120
+ return isInterceptionMethod (method , AROUND_INVOKE_ANNOTATION_TYPE , Object .class );
109
121
}
110
122
111
123
/**
@@ -126,7 +138,7 @@ public static boolean isAroundInvokeMethod(Method method) {
126
138
* or if the return type of method is not <code>Object</code> or its derived type.
127
139
*/
128
140
public static boolean isAroundTimeoutMethod (Method method ) {
129
- return isInterceptionMethod (method , AroundTimeout . class , Object .class );
141
+ return isInterceptionMethod (method , AROUND_TIMEOUT_ANNOTATION_TYPE , Object .class );
130
142
}
131
143
132
144
/**
@@ -140,7 +152,7 @@ public static boolean isAroundTimeoutMethod(Method method) {
140
152
* or if the return type of method is not <code>void</code>
141
153
*/
142
154
public static boolean isAroundConstructMethod (Method method ) {
143
- return isInterceptionMethod (method , AroundConstruct . class , void .class );
155
+ return isInterceptionMethod (method , AROUND_CONSTRUCT_ANNOTATION_TYPE , void .class );
144
156
}
145
157
146
158
/**
@@ -154,7 +166,7 @@ public static boolean isAroundConstructMethod(Method method) {
154
166
* or if the return type of method is not <code>void</code>
155
167
*/
156
168
public static boolean isPostConstructMethod (Method method ) {
157
- return isInterceptionMethod (method , PostConstruct . class , void .class );
169
+ return isInterceptionMethod (method , POST_CONSTRUCT_ANNOTATION_TYPE , void .class );
158
170
}
159
171
160
172
/**
@@ -168,7 +180,7 @@ public static boolean isPostConstructMethod(Method method) {
168
180
* or if the return type of method is not <code>void</code>
169
181
*/
170
182
public static boolean isPreDestroyMethod (Method method ) {
171
- return isInterceptionMethod (method , PreDestroy . class , void .class );
183
+ return isInterceptionMethod (method , PRE_DESTROY_ANNOTATION_TYPE , void .class );
172
184
}
173
185
174
186
@@ -282,7 +294,7 @@ private static void validateInterceptorClassMethods(Class<?> interceptorClass) {
282
294
}
283
295
284
296
public static boolean isAnnotatedInterceptorBinding (Class <? extends Annotation > annotationType ) {
285
- return isMetaAnnotation (annotationType , InterceptorBinding . class );
297
+ return isMetaAnnotation (annotationType , INTERCEPTOR_BINDING_ANNOTATION_TYPE );
286
298
}
287
299
288
300
public static boolean isAnnotatedInterceptorBinding (Executable executable ,
0 commit comments