Component Installation - mareknovotny/seam-migration GitHub Wiki

Install — Conditional installation

Seam 2 offers the @Install annotation for controlling whether a given bean should be installed or not. The following concepts are supported and can be configured using the annotation:

  • explicit prevention from installation

  • installation dependencies

  • bean specialization

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.

Concept Seam 2 CDI

explicit prevention from installation

@Install(false)

DeltaSpike’s @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

⚠️ **GitHub.com Fallback** ⚠️