Skip to content

Component Installation

LightGuard edited this page Jan 25, 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 / Seam 3
explicit prevention from installation
@Install(false)
Veto</pre> or <pre class="wikiPreformatted">Alternative
installation dependencies
@Install(dependencies = “foo”)
@Requires(“javax.persistence.EntityManager”)
Note that class-level dependencies are supported only
bean selection based component ordering (precedence)
@Install(precedence = MOCK)
Alternative</pre> or Alternative <a href="http://docs.jboss.org/cdi/spec/1.0/html/concepts.html#stereotypes" target="" class="regularLink">stereotype</a> or <pre class="wikiPreformatted">Specializes
Clone this wiki locally