36.3. @Install
Seam 2 offers the
@Install annotation for controlling whether a given bean should be installed or not together with configurable functionality.
The CDI specification itself does not define a single replacement for all the functionality represented by the
@Install annotation. Instead, the concepts are implemented separately as outlined in the table here.
Table 36.2. Corresponding Seam 2 and CDI Conditional Bean Installation
| Concept | Seam 2 | CDI |
|---|---|---|
|
Explicit prevention from installation
| @Install(false)
|
DeltaSpike
@Exclude annotation. Also, an extension can observe the ProcessAnnotatedType event and call the veto() method.
|
|
Installation dependencies
| @Install(dependencies = "foo")
|
No match.
|
|
Bean specialization
| @Install(precedence = MOCK)
| @Alternative or @Specializes
|