001package io.ebean;
002
003/**
004 * Provides a callback that can be registered with a Transaction.
005 * <p/>
006 * The callback methods are called just prior to and after the transaction performs a commit or rollback.
007 * <p/>
008 * A typical use of TransactionCallback would be to clean up non-transactional resources like files. For example,
009 * when processing files on postCommit/postRollback clean up the associated files. As another example when
010 * on postCommit of a delete remove associated resources from the file system or remote service.
011 */
012public interface TransactionCallback {
013
014  /**
015   * Perform processing just prior to the transaction commit.
016   */
017  void preCommit();
018
019  /**
020   * Perform processing just after the transaction commit.
021   */
022  void postCommit();
023
024  /**
025   * Perform processing just prior to the transaction rollback.
026   */
027  void preRollback();
028
029  /**
030   * Perform processing just after the transaction rollback.
031   */
032  void postRollback();
033
034}