users@jms-spec.java.net

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

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Mon, 13 Feb 2012 14:11:11 +0000

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?