-
Notifications
You must be signed in to change notification settings - Fork 78
/
Registration.java
54 lines (52 loc) · 2.24 KB
/
Registration.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package jakarta.enterprise.inject.build.compatible.spi;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 3rd phase of {@linkplain BuildCompatibleExtension build compatible extension} execution.
* Allows observing registered beans and observers.
* <p>
* This phase is executed twice.
* For non-synthetic beans and observers, this phase is executed <em>before</em> {@linkplain Synthesis synthesis}.
* For synthetic beans and observers, this phase is executed <em>after</em> synthesis.
* <p>
* In the following text, the term <em>expected types</em> denotes the set of types defined by
* the {@link #types() types} member of the {@code @Registration} annotation.
* <p>
* Methods annotated {@code @Registration} must declare exactly one parameter of one of these types:
* <ul>
* <li>{@link BeanInfo}</li>
* <li>{@link InterceptorInfo}</li>
* <li>{@link ObserverInfo}</li>
* </ul>
* If a {@code @Registration} method has a parameter of type {@code BeanInfo}, the method is called once
* for each bean whose set of bean types contains at least one <em>expected type</em>.
* <p>
* If the {@code @Registration} method has a parameter of type {@code InterceptorInfo}, the method is called once
* for each interceptor whose set of bean types contains at least one <em>expected type</em>.
* <p>
* If the {@code @Registration} method has a parameter of type {@code ObserverInfo}, the method is called once
* for each observer whose observed event type is assignable to at least one <em>expected type</em>.
* <p>
* Note that interceptors are beans, and {@code InterceptorInfo} is a subtype of {@code BeanInfo}, so if the method
* has a parameter of type {@code BeanInfo}, it will be called for interceptors as well.
* <p>
* Additionally, methods annotated {@code @Registration} may declare parameters of these types:
* <ul>
* <li>{@link Messages}</li>
* <li>{@link Types}</li>
* </ul>
*
* @since 4.0
*/
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Registration {
/**
* Defines the set of <em>expected types</em>.
*
* @return the set of <em>expected types</em>
*/
Class<?>[] types();
}