Interface TransactionCommitListener


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

    • transactionCommited

      @CheckForNull Runnable transactionCommited(Collection<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 Runnable toRunnable(@CheckForNull Collection<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 Runnable toRunnable(Stream<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> Runnable toRunnable(@CheckForNull Collection<T> elements, 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