users@jms-spec.java.net

[jms-spec users] [jsr343-experts] Late change: A.2.1 Simplified API: Injecting a JMSContext

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Tue, 15 Jan 2013 11:29:30 +0000

I am now working my way through Appendix A "Issues" in the draft spec. This lists various issues with spec content which
were unresolved at the time of writing.

In this email I'd like to review the issue described in A.2.1 "Simplified API: Injecting a JMSContext":

---------------------------------------------------------------------
"The JMS 2.0 Early Draft release proposes how in a Java EE application JMSContext objects can be injected. See section
11.3 "Injection of JMSContext objects" for details.

"The container is responsible for creating JMSContext objects and in closing them after use.

"How much does the specification need to say about how such objects are managed by the container? To some extent this
can be considered an implementation detail which can be left to the container. However there are cases when the
application needs to know whether two successive calls to methods on a JMSContext apply to the same or different
sessions, since JMS only defines the relative order of messages produced using rhe same session.
---------------------------------------------------------------------

I can't remember exactly what the issue was that led me to write that. In any case I think this is answered by section
11.3.4 "Scope of injected objects".

The specific question posed above is explicitly answered in 11.3.4, which describes the scope of injected JMSContext
objects. Two successive calls to methods on an injected JMSContext will apply to the same session so long as they are in
the same JTA transaction or, if there is no JTA transaction, the same CDI request.

I propose deleting 11.3 "Injection of JMSContext objects" from the "Issues" list as this is no longer an open issue.

However if anyone thinks 11.3.4 "Scope of injected objects" (or any other section) needs to be clarified please say so.

Nigel