001package org.dcm4che3.conf.core.api;
002
003/**
004 * @author Roman K
005 */
006public interface BatchRunner {
007    /**
008     * Provides support for batching configuration changes.
009     * </p>
010     * It is guaranteed that
011     * <ul>
012     * <li>All configuration reads and writes in a batch are performed within a single transaction, i.e. the changes are atomic and performed in READ COMMITTED isolation</li>
013     * <li>When this method is called, an ongoing transaction (in case there is one) will be SUSPENDED. The batch will ALWAYS be executed in a SEPARATE transaction.</li>
014     * <li>At most ONE batch is executed at the same time in the whole cluster (synchronized with a database lock)</li>
015     * </ul>
016     *
017     * @param batch Configuration batch change to execute
018     */
019    void runBatch(Batch batch);
020
021    /**
022     * Defines a configuration batch that allows to execute configuration changes in a bulk-type manner.
023     *
024     * @author Alexander Hoermandinger <alexander.hoermandinger@agfa.com>
025     */
026    interface Batch extends Runnable{
027    }
028}