jsr343-experts@jms-spec.java.net

[jsr343-experts] Re: (JMS_SPEC-48) Specify that connection.stop() or close() may not be called from a MessageListener

From: Nigel Deakin <nigel.deakin_at_oracle.com>
Date: Wed, 04 Jan 2012 15:58:32 +0000

On 16/09/2011 16:02, Nigel Deakin wrote:
> On 16/08/2011 15:05, Nigel Deakin wrote:
>> I have created this JIRA issue
>> http://java.net/jira/browse/JMS_SPEC-48
>>
>> This issue was raised by Graham. As always, please do give your comments.

I've now updated the javadocs and the draft spec
(these changes are additive, so those docs include other changes).

The updated draft spec is here:
http://java.net/projects/jms-spec/sources/repository/content/jms2.0/specification/word/JMS20.pdf
(all changes are highlighted clearly with changebars)

Section 4.3.4 "Pausing Delivery of Incoming Messages"

     A message listener must not attempt to stop its own connection as this would lead to deadlock. The JMS provider
must detect this and throw a javax.jms.IllegalStateException.

Section 4.3.5 "Closing a Connection"

     A message listener must not attempt to close its own connection as this would lead to deadlock. The JMS provider
must detect this and throw a javax.jms.IllegalStateException.

Section 4.4.1 "Closing a Session"

     A message listener must not attempt to close its own session as this would lead to deadlock. The JMS provider must
detect this and throw a javax.jms.IllegalStateException.

Section 11.5.12 "Clarification of use of stop or close from a message listener (JMS_SPEC-48)"

This is the change log for this issue.

The updated Javadocs are here:
http://java.net/projects/jms-spec/sources/repository/content/jms2.0/target/jms-2.0-javadoc.jar

New javadoc comment on Connection.stop():

       * A message listener must not attempt to stop its own connection as this
       * would lead to deadlock. The JMS provider must detect this and throw a
       * javax.jms.IllegalStateException.

New javadoc comment on Connection.close():

       * A message listener must not attempt to close its own connection as this
       * would lead to deadlock. The JMS provider must detect this and throw a
       * javax.jms.IllegalStateException.

New javadoc comment on Session.close():

       * A message listener must not attempt to close its own session as this
       * would lead to deadlock. The JMS provider must detect this and throw a
       * javax.jms.IllegalStateException.

New javadoc comment on MessagingContext.stop():

      * A message listener must not attempt to stop its own MessagingContext as this
      * would lead to deadlock. The JMS provider must detect this and throw a
      * javax.jms.IllegalStateRuntimeException.

New javadoc comment on MessagingContext.close():

      * A message listener must not attempt to close its own MessagingContext as this
      * would lead to deadlock. The JMS provider must detect this and throw a
      * javax.jms.IllegalStateRuntimeException.

Nigel