users@jms-spec.java.net

[jms-spec users] Re: [jsr343-experts] Re: (JMS_SPEC-70) Define annotations for injecting MessagingContext objects

From: Pete Muir <pmuir_at_bleepbleep.org.uk>
Date: Tue, 14 Feb 2012 09:49:08 +0000

I'm not entirely following your comment John? We have a pattern for injecting persistence contexts using CDI - the resource producer pattern. We discussed that this isn't always relevant for JMS as often the metadata associated with each injection point changes (however, it may still be useful for some apps).

Were we specifying persistence context injection on top of CDI, I think we would see something akin to Nigel's proposal here.

Pete

On 13 Feb 2012, at 19:24, John D. Ament wrote:

> Nigel,
>
> It's more of an observation rather than anything. Since we inject using persistence context into an active EJB context, the EE platform allows more generic injection similar to what we are trying to achieve with messaging context. I'm wondering how CDI will handle this type of injection.
>
> John
>
>
> On Mon, Feb 13, 2012 at 9:11 AM, Nigel Deakin <nigel.deakin_at_oracle.com> wrote:
> John,
>
>
> On 11/02/2012 15:39, John D. Ament wrote:
> I've been thinking on this subject a bit. I think the issue is that for JMS to work right with injection and
> annotations, the annotations need to act like the annotations in JPA when injection is supported (e.g.
> @PersistenceContext).
>
> Can you please elaborate on this? There are several aspects to PersistenceContext and I'd be interested in knowing what particular aspects you had in mind.
>
> You can use the @PersistenceContext annotation to inject a EntityManager:
>
> @PersistenceContext EntityManager em;
>
> Compare this with the current proposal to inject a MessagingContext:
>
> @Inject MessagingContext context;
>
> Were you thinking of replacing "@Inject" with something more specific?
>
> Or were you thinking of something else, like the ability to annotate methods?
>
> Nigel
>
>
>
> > I don't think CDI has this supported quite well yet. Pete, any comment on this?
>
>