Class SessionClosingSynchronization

  • All Implemented Interfaces:
    javax.transaction.Synchronization

    public class SessionClosingSynchronization
    extends java.lang.Object
    implements javax.transaction.Synchronization
    Synchronization to close JMS session at the end of the transaction.
    Author:
    Gytis Trikleris
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterCompletion​(int status)
      Close the session no matter what the status of the transaction is.
      void beforeCompletion()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SessionClosingSynchronization

        public SessionClosingSynchronization​(java.lang.AutoCloseable session)
        Parameters:
        session - session to be closed.
    • Method Detail

      • beforeCompletion

        public void beforeCompletion()
        Specified by:
        beforeCompletion in interface javax.transaction.Synchronization
      • afterCompletion

        public void afterCompletion​(int status)
        Close the session no matter what the status of the transaction is.
        Specified by:
        afterCompletion in interface javax.transaction.Synchronization
        Parameters:
        status - the status of the completed transaction