public class ViewScopedExtension extends Object implements javax.enterprise.inject.spi.Extension, Deactivatable
This CDI extension enables support for the new JSF-2 @ViewScoped annotation.
2 steps are necessary:
NormalScope,
since this annotation is neither a JSR-330 annotation
nor a JSR-299 annotation and therefor doesn't get picked up automatically. This has to be
before the bean scanning starts.Context for the
ViewScoped. The ViewScopedContext is responsible for actually storing all our
@ViewScoped contextual instances in the JSF ViewMap.The extension automatically detects if we are in the
ProjectStage.UnitTest and uses
| Constructor and Description |
|---|
ViewScopedExtension() |
| Modifier and Type | Method and Description |
|---|---|
void |
addViewScoped(javax.enterprise.inject.spi.BeforeBeanDiscovery beforeBeanDiscovery) |
boolean |
isActivated()
Returns if the current instance is active or not.
|
void |
registerViewContext(javax.enterprise.inject.spi.AfterBeanDiscovery afterBeanDiscovery) |
public void addViewScoped(@Observes
javax.enterprise.inject.spi.BeforeBeanDiscovery beforeBeanDiscovery)
public void registerViewContext(@Observes
javax.enterprise.inject.spi.AfterBeanDiscovery afterBeanDiscovery)
public boolean isActivated()
org.apache.myfaces.extensions.cdi.core.api.activation.DeactivatableisActivated in interface DeactivatableCopyright © 2010-2014 The Apache Software Foundation. All Rights Reserved.