jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: JMS Object Scopes

From: John D. Ament <john.d.ament_at_gmail.com>
Date: Wed, 7 Sep 2011 21:27:31 -0400

Reza,

I'm not sure why you believe the limitation has to do with producer
methods. It's really going to boil down to how the TransactionScoped scope
is implemented in CDI 1.1. For example, we implemented a concept of
ExtensionManaged objects in Seam 3 (for the record, I voted against the name
:-) ). The main object here is EntityManager/EntityManagerFactory, since
the annotation was derived from the Persistence project. Essentially, we
need to define specific scope behavior, life cycle to manage an entity
manager from within the CDI ConversationScoped scoped. Essentially, I think
in order to implement your TransactionScoped requirements properly in JMS we
would need to implement similar functionality in the CDI "outer API" to
support injection in the same behavior. IN this case, I'm not even sure
that having it all within a single JTA transaction makes sense.
Conversations (in CDI) work well by essentially being a dependent scoped
object but at any level, though we can't currently do nested conversations
(at least, that was the last I remember).

Here's a few links to examples of what we ended up doing:

https://raw.github.com/seam/persistence/develop/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextExtension.java
https://raw.github.com/seam/persistence/develop/impl/src/main/java/org/jboss/seam/persistence/ManagedPersistenceContextBeanLifecycle.java


On Wed, Sep 7, 2011 at 10:58 AM, Reza Rahman <reza_rahman_at_lycos.com> wrote:

> John,
>
> Hmm - if I am reading this correctly, it seems pretty limiting. I'll test
> this out in CanDI and see what it actually means. The solution here again
> might be to just avoid producers and use the SPI to resolve injection points
> at deployment time rather than at runtime. Also, let's see how necessary
> this restriction really is. Maybe we can get it removed in CDI 1.1 so you
> could you producers for more things like the sort of features we need for
> JMS 2?
>
> Cheers,
> Reza
>
>
>
> On 9/7/2011 5:57 AM, John D. Ament wrote:
>
>> Reza,
>>
>> I would refer to section 5.5.7 of JSR-299 which only refers to the
>> InjectionPoint metadata object as being available for @Dependent beans..
>> This is not a bug.
>>
>>