[
https://issues.apache.org/jira/browse/DELTASPIKE-874?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Rafael Benevides updated DELTASPIKE-874:
----------------------------------------
Comment: was deleted
(was: I realised that this is already documented here:
http://deltaspike.apache.org/documentation/jsf#_event_broadcasting Or Am I
missing something about DELTASPIKE-874 ?)
> observe @javax.faces.bean.RequestScoped via
> @javax.enterprise.context.Initialized and @javax.enterprise.context.Destroyed
> -------------------------------------------------------------------------------------------------------------------------
>
> Key: DELTASPIKE-874
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-874
> Project: DeltaSpike
> Issue Type: New Feature
> Components: JSF-Module
> Affects Versions: 1.3.0
> Reporter: Mark Struberg
> Assignee: Gerhard Petracek
> Fix For: 1.3.1
>
>
> currently it's supported to observe faces-requests via
> org.apache.deltaspike.core.api.lifecycle.Initialized and
> org.apache.deltaspike.core.api.lifecycle.Destroyed
> since cdi 1.1 there are annotations with the same name.
> to avoid confusion, we can support those annotations optionally (if cdi 1.1+
> is available). both cdi 1.1+ annotations require the corresponding
> scope-annotation as value. since javax.enterprise.context.RequestScoped is
> supported out-of-the-box and this event is about the faces-request, we have
> to use javax.faces.bean.RequestScoped.
> the benefit is that it's possible to observe faces-requests via std.
> annotations and it's possible to access the faces-context (which isn't the
> case with an observer for javax.enterprise.context.RequestScoped).
> cdi 1.1+ out-of-the-box support:
> {code}
> protected void onRequestStart(@Observes
> @javax.enterprise.context.Initialized(javax.enterprise.context.RequestScoped.class)
> Object payload) {
> //...
> }
> protected void onRequestEnd(@Observes
> @javax.enterprise.context.Destroyed(javax.enterprise.context.RequestScoped.class)
> Object payload) {
> //...
> }
> {code}
> ds observer for cdi 1.0+
> {code}
> protected void onFacesRequestStart(@Observes
> @org.apache.deltaspike.core.api.lifecycle.Initialized FacesContext
> facesContext) {
> //...
> }
> protected void onFacesRequestEnd(@Observes
> @org.apache.deltaspike.core.api.lifecycle.Destroyed FacesContext
> facesContext) {
> //...
> }
> {code}
> additional option for cdi 1.1+ introduced by this ticket:
> {code}
> protected void onFacesRequestStart(@Observes
> @javax.enterprise.context.Initialized(javax.faces.bean.RequestScoped.class)
> FacesContext facesContext) {
> //...
> }
> protected void onFacesRequestEnd(@Observes
> @javax.enterprise.context.Destroyed(javax.faces.bean.RequestScoped.class)
> FacesContext facesContext) {
> //...
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)