Overview
Other MyFaces Extensions
- ExtVal
- Ext-Script
- [Orchestra]
- [Portlet Bridge]
Community
Development
Sponsorship
Your browser does not support iframes
...
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
@Inject private ProjectStage projectStage; //... boolean isDevProjectStage = ProjectStage.Development.equals(this.projectStage); |
To configure the project-stage via the Service-Loader mechanism, it's required to implement the ProjectStageHolder
interface. In this class you nest the custom project-stage implementations which have to be public static final class
and it's required to extend ProjectStage
.
...
public class CustomProjectStage implements ProjectStageHolder
{
public static final class Debugging extends ProjectStage
{
private static final long serialVersionUID = -8626602281649294170L;
}
public static final Debugging Debugging = new Debugging();
}
It's required to provide a {{public static final}} instance even though, you won't use it directly.
Furthermore, you have to add the *fully qualified* class to /META-INF/services/org.apache.myfaces.extensions.cdi.core.api.projectstage.ProjectStageHolder
{code:java|title=Using a custom project-stage implementation}
@ProjectStageActivated({CustomProjectStage.Debugging.class})
public class DebuggingAspect
{
//...
}
...
Register a custom StartupEventBroadcaster for integrating a broadcaster which gets invoked before the StartupEvent gets fired.
Attention: There is no guarantee that CDI has been bootstrapped.
However, a StartupEventBroadcaster allows to do it (see the controlled bootstrapping add-on).
Note | ||
---|---|---|
| ||
The usage of @InvocationOrder is supported. |
...