Class ConnectionClosingSynchronization

  • All Implemented Interfaces:
    javax.transaction.Synchronization

    public class ConnectionClosingSynchronization
    extends java.lang.Object
    implements javax.transaction.Synchronization
    Synchronization to close JMS connection 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 connection 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

      • ConnectionClosingSynchronization

        public ConnectionClosingSynchronization​(javax.jms.Connection connection)
        Parameters:
        connection - connection 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 connection 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