Class SessionClosingSynchronization

  • All Implemented Interfaces:
    jakarta.transaction.Synchronization

    public class SessionClosingSynchronization
    extends Object
    implements jakarta.transaction.Synchronization
    Synchronization to close JMS session at the end of the transaction.
    Author:
    Gytis Trikleris
    • Constructor Detail

      • SessionClosingSynchronization

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

      • beforeCompletion

        public void beforeCompletion()
        Specified by:
        beforeCompletion in interface jakarta.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 jakarta.transaction.Synchronization
        Parameters:
        status - the status of the completed transaction