[weld-dev] JavaEE component classes - JPA entity listener

Jozef Hartinger jharting at redhat.com
Tue Jun 23 02:25:32 EDT 2015


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.

Jozef

On 06/22/2015 02:25 PM, Emily Jiang wrote:
> Jozef,
> Just re-iterate my concern:
> The implementation is in eclipse link. I guess they don't want to 
> depend on a specific CDI implementation. Therefore, what you suggested 
> may not be accepted by the eclipse link project.
>
> Thanks
> Emily
>
>
> On Sun, Jun 21, 2015 at 10:59 PM, Emily Jiang 
> <emijiang6 at googlemail.com <mailto:emijiang6 at googlemail.com>> wrote:
>
>     thanks Jozef!
>
>     On Sun, Jun 21, 2015 at 10:58 PM, Emily Jiang
>     <emijiang6 at googlemail.com <mailto:emijiang6 at googlemail.com>> wrote:
>
>         Jozef,
>         The implementation is in eclipse link. I guess they don't want
>         to depend on a specific CDI implementation.
>         Thanks
>         Emily
>
>         On Sun, Jun 21, 2015 at 8:42 PM, Jozef Hartinger
>         <jharting at redhat.com <mailto:jharting at redhat.com>> wrote:
>
>             Hi Emily,
>
>             the implementation should call the following method
>             http://docs.jboss.org/weld/javadoc/2.2/weld-spi/org/jboss/weld/manager/api/WeldManager.html#fireProcessInjectionTarget-javax.enterprise.inject.spi.AnnotatedType-javax.enterprise.inject.spi.InjectionTarget-
>             on Weld BeanManager and use the returned value as the
>             InjectionTarget.
>
>             HTH,
>
>             Jozef
>
>
>             On 06/19/2015 12:28 PM, Emily Jiang wrote:
>>
>>             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]
>>             -- 
>>             Thanks
>>             Emily
>>             =================
>>             Emily Jiang
>>             ejiang at apache.org <mailto:ejiang at apache.org>
>>
>>
>>             _______________________________________________
>>             weld-dev mailing list
>>             weld-dev at lists.jboss.org  <mailto:weld-dev at lists.jboss.org>
>>             https://lists.jboss.org/mailman/listinfo/weld-dev
>
>
>
>
>         -- 
>         Thanks
>         Emily
>         =================
>         Emily Jiang
>         ejiang at apache.org <mailto:ejiang at apache.org>
>
>
>
>
>     -- 
>     Thanks
>     Emily
>     =================
>     Emily Jiang
>     ejiang at apache.org <mailto:ejiang at apache.org>
>
>
>
>
> -- 
> Thanks
> Emily
> =================
> Emily Jiang
> ejiang at apache.org <mailto:ejiang at apache.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/weld-dev/attachments/20150623/6e7d2361/attachment.html 


More information about the weld-dev mailing list