org.jboss.jms.client.container
Class SessionAspect

java.lang.Object
  extended byorg.jboss.jms.client.container.SessionAspect

public class SessionAspect
extends java.lang.Object

This aspect handles JMS session related logic This aspect is PER_VM

Author:
Ovidiu Feodorov $Id: SessionAspect.java 2655 2007-05-08 15:57:02Z timfox $

Constructor Summary
SessionAspect()
           
 
Method Summary
 java.lang.Object handleAcknowledgeAll(Invocation invocation)
           
 java.lang.Object handleClose(Invocation invocation)
           
 java.lang.Object handleClosing(Invocation invocation)
           
 java.lang.Object handleGetAcknowledgeMode(Invocation invocation)
           
 java.lang.Object handleGetTransacted(Invocation invocation)
           
 java.lang.Object handleGetXAResource(Invocation invocation)
           
 java.lang.Object handlePostDeliver(Invocation invocation)
           
 java.lang.Object handlePreDeliver(Invocation invocation)
           
 java.lang.Object handleRecover(Invocation invocation)
           
 java.lang.Object handleRedeliver(Invocation invocation)
          Redelivery occurs in two situations: 1) When session.recover() is called (JMS1.1 4.4.11) "A session's recover method is used to stop a session and restart it with its first unacknowledged message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionAspect

public SessionAspect()
Method Detail

handleClosing

public java.lang.Object handleClosing(Invocation invocation)
                               throws java.lang.Throwable
Throws:
java.lang.Throwable

handleClose

public java.lang.Object handleClose(Invocation invocation)
                             throws java.lang.Throwable
Throws:
java.lang.Throwable

handlePreDeliver

public java.lang.Object handlePreDeliver(Invocation invocation)
                                  throws java.lang.Throwable
Throws:
java.lang.Throwable

handleAcknowledgeAll

public java.lang.Object handleAcknowledgeAll(Invocation invocation)
                                      throws java.lang.Throwable
Throws:
java.lang.Throwable

handlePostDeliver

public java.lang.Object handlePostDeliver(Invocation invocation)
                                   throws java.lang.Throwable
Throws:
java.lang.Throwable

handleRecover

public java.lang.Object handleRecover(Invocation invocation)
                               throws java.lang.Throwable
Throws:
java.lang.Throwable

handleRedeliver

public java.lang.Object handleRedeliver(Invocation invocation)
                                 throws java.lang.Throwable
Redelivery occurs in two situations: 1) When session.recover() is called (JMS1.1 4.4.11) "A session's recover method is used to stop a session and restart it with its first unacknowledged message. In effect, the session's series of delivered messages is reset to the point after its last acknowledged message." An important note here is that session recovery is LOCAL to the session. Session recovery DOES NOT result in delivered messages being cancelled back to the channel where they can be redelivered - since that may result in them being picked up by another session, which would break the semantics of recovery as described in the spec. 2) When session rollback occurs (JMS1.1 4.4.7). On rollback of a session the spec is clear that session recovery occurs: "If a transaction rollback is done, its produced messages are destroyed and its consumed messages are automatically recovered. For more information on session recovery, see Section 4.4.11 'Message Acknowledgment.'" So on rollback we do session recovery (local redelivery) in the same as if session.recover() was called. There is a conflict here though. It seems a CTS test requires messages to be available to OTHER sessions on rollback - see CTSMiscellaneousTest.testContestedQueueOnRollback(), which seems in direct contradiction to the spec. In order to satisfy the test, on session recovery, if there are no local consumers available to consume the message, we cancel the message back to the channel.

Throws:
java.lang.Throwable

handleGetXAResource

public java.lang.Object handleGetXAResource(Invocation invocation)
                                     throws java.lang.Throwable
Throws:
java.lang.Throwable

handleGetTransacted

public java.lang.Object handleGetTransacted(Invocation invocation)
                                     throws java.lang.Throwable
Throws:
java.lang.Throwable

handleGetAcknowledgeMode

public java.lang.Object handleGetAcknowledgeMode(Invocation invocation)
                                          throws java.lang.Throwable
Throws:
java.lang.Throwable


Copyright © 2006 JBoss Inc. All Rights Reserved.