Skip to content

Component Installation

LightGuard edited this page Feb 11, 2012 · 3 revisions

@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 selection based component ordering (precedence)

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)
No annotation, however, an extension can observe the ProcessAnnotatedType event and call the veto() method.
installation dependencies
@Install(dependencies = “foo”)
No match
bean selection based component ordering (precedence)
@Install(precedence = MOCK)
@Alternative
or
@Specializes
Clone this wiki locally