Interface TransactionCommitListener


  • public interface TransactionCommitListener
    Listener to listen transactions commits.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default void allTransactionsCommitted()
      Invoked when all transactions are already committed.
      static java.lang.Runnable toRunnable​(java.util.Collection<java.lang.Runnable> runnable)
      Merges given Runnables to a single composite Runnable
      static <T> java.lang.Runnable toRunnable​(java.util.Collection<T> elements, java.util.function.Consumer<T> consumer)
      Creates consumer which consumes all elements from given collection
      static java.lang.Runnable toRunnable​(java.util.stream.Stream<java.lang.Runnable> runnableStream)
      Merges given Runnables to a single composite Runnable
      java.lang.Runnable transactionCommited​(java.util.Collection<java.beans.PropertyChangeEvent> events)
      Notifies listener that transaction is committed and provides changes done in transaction.
    • Method Detail

      • transactionCommited

        @CheckForNull
        java.lang.Runnable transactionCommited​(java.util.Collection<java.beans.PropertyChangeEvent> events)
        Notifies listener that transaction is committed and provides changes done in transaction. Listener can return Runnable which modifies model after all listeners are notified.
        Parameters:
        events - events recorded during transaction.
        Returns:
        Runnable which will be run to modify model after all listeners are notified. Can be null.
      • allTransactionsCommitted

        default void allTransactionsCommitted()
        Invoked when all transactions are already committed.
      • toRunnable

        @CheckForNull
        static java.lang.Runnable toRunnable​(@CheckForNull
                                             java.util.Collection<java.lang.Runnable> runnable)
        Merges given Runnables to a single composite Runnable
        Parameters:
        runnable - runnables
        Returns:
        composite Runnable or null if given runnables are empty
      • toRunnable

        @CheckForNull
        static java.lang.Runnable toRunnable​(java.util.stream.Stream<java.lang.Runnable> runnableStream)
        Merges given Runnables to a single composite Runnable
        Parameters:
        runnableStream - stream of Runnable
        Returns:
        composite Runnable or null if given stream is empty
      • toRunnable

        @CheckForNull
        static <T> java.lang.Runnable toRunnable​(@CheckForNull
                                                 java.util.Collection<T> elements,
                                                 java.util.function.Consumer<T> consumer)
        Creates consumer which consumes all elements from given collection
        Parameters:
        elements - elements to be consumed
        consumer - consumer
        Returns:
        runnable or null if elements collection is null or empty