[cdi-dev] [JBoss JIRA] (CDI-537) Event firing on JavaEE component classes- JPA entity listener

Emily Jiang (JIRA) issues at jboss.org
Tue Jun 23 09:22:01 EDT 2015


     [ https://issues.jboss.org/browse/CDI-537?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Emily Jiang updated CDI-537:
----------------------------
    Affects Version/s: 1.2.Final
          Description: 
In CDI 1.2 spec
11.5.7. ProcessInjectionPoint event
The container must fire an event for every injection point of every Java EE component class
supporting injection that may be instantiated by the container at runtime, including every managed bean declared using @ManagedBean, EJB session or message-driven bean, bean, interceptor or decorator.

The JavaEE component classes are mentioned in JavaEE platform EE.5-1, which includes servlets, servlet filters, entity listeners etc.

My concern is about entity listeners in JPA. Eclipse link has done all the injection for entity listeners. It does not fire the event, @See createEntityListenerAndInjectDependancies(...)

JPA spec section 3.5.1 does not mention this event requirement. How can the eclipse cdi implementation satisfy the CDI spec?

[1] http://git.eclipse.org/c/eclipselink/eclipselink.runtime.git/tree/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/cdi/EntityListenerInjectionManagerImpl.java?h=2.6_WAS]

I had an initial discussion with Jozef. 
Jozef wrote: "
Doing this using purely CDI APIs can be a bit tricky. One option that will most likely work is to combine BeanManager.resolveObserverMethods() method with a custom implementation of ProcessInjectionTarget interface. That way you can resolve the matching observer methods and then call their notify() method to deliver the event. Exception handling needs to be implemented to match the spec.

We should update the spec to define a more direct route and for the JPA spec to mention this requirement."

My response:
"+1 on revisiting this on the CDI spec. I think adding an additional method on the BeanManager api, e.g. fireProcessInjectionTarget would be good. Effectively, it is to promote this very method on WeldManager to BeanManager."


> Event firing on JavaEE component classes- JPA entity listener
> -------------------------------------------------------------
>
>                 Key: CDI-537
>                 URL: https://issues.jboss.org/browse/CDI-537
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>          Components: Java EE integration
>    Affects Versions: 1.2.Final
>            Reporter: Emily Jiang
>
> In CDI 1.2 spec
> 11.5.7. ProcessInjectionPoint event
> The container must fire an event for every injection point of every Java EE component class
> supporting injection that may be instantiated by the container at runtime, including every managed bean declared using @ManagedBean, EJB session or message-driven bean, bean, interceptor or decorator.
> The JavaEE component classes are mentioned in JavaEE platform EE.5-1, which includes servlets, servlet filters, entity listeners etc.
> My concern is about entity listeners in JPA. Eclipse link has done all the injection for entity listeners. It does not fire the event, @See createEntityListenerAndInjectDependancies(...)
> JPA spec section 3.5.1 does not mention this event requirement. How can the eclipse cdi implementation satisfy the CDI spec?
> [1] http://git.eclipse.org/c/eclipselink/eclipselink.runtime.git/tree/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/sessions/cdi/EntityListenerInjectionManagerImpl.java?h=2.6_WAS]
> I had an initial discussion with Jozef. 
> Jozef wrote: "
> Doing this using purely CDI APIs can be a bit tricky. One option that will most likely work is to combine BeanManager.resolveObserverMethods() method with a custom implementation of ProcessInjectionTarget interface. That way you can resolve the matching observer methods and then call their notify() method to deliver the event. Exception handling needs to be implemented to match the spec.
> We should update the spec to define a more direct route and for the JPA spec to mention this requirement."
> My response:
> "+1 on revisiting this on the CDI spec. I think adding an additional method on the BeanManager api, e.g. fireProcessInjectionTarget would be good. Effectively, it is to promote this very method on WeldManager to BeanManager."



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)


More information about the cdi-dev mailing list