Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This annotation allows to activate beans for a special project-stage. It's possible to use one of the out-of-the-box project-stages or a custom typesafe project-stage.

Code Block
java
java
titleAlternative implementation activated for Project-Stage UnitTest
@Alternative
@ProjectStageActivated(ProjectStage.UnitTest.class)
public class TestServiceMockImpl implements Service
{
  //...
}
Code Block
java
java
titleAlternative implementation activated for Project-Stage Stages UnitTest and Development
@Alternative
@ProjectStageActivated({ProjectStage.UnitTest.class, ProjectStage.Development.class})
public class DevServiceMockImpl implements Service
{
  //...
}

To configure a project-stage you can use the key: org.apache.myfaces.extensions.cdi.ProjectStage and configure it for your environment (see the out-of-the-box environment-config options).
If there is no CODI project-stage configured and it's a JSF application, CODI will re-use the project-stage configured for JSF (currently the web.xml approach isn't supported because in our opinion it's a wrong and quite risky place to configure it - however, with a custom ConfiguredValueResolver it's possible to resolve the project-stage configuration from any kind of configuration-source).

...