All Downloads are FREE. Search and download functionalities are using the official Maven repository.

sirius.kernel.async.Orchestration Maven / Gradle / Ivy

Go to download

Provides common core classes and the microkernel powering all Sirius applications

There is a newer version: 12.9.1
Show newest version
/*
 * Made with all the love in the world
 * by scireum in Remshalden, Germany
 *
 * Copyright by scireum GmbH
 * http://www.scireum.de - [email protected]
 */

package sirius.kernel.async;

/**
 * Provides a way of intercepting background tasks like {@link BackgroundLoop} and {@link sirius.kernel.timer.EveryDay}
 * to synchronize those activities across a cluster.
 */
public interface Orchestration {

    /**
     * Determines if the background loop with the given name should be executed.
     *
     * @param name the name of the loop
     * @return true if the loop should be executed on this node, false otherwise
     */
    boolean tryExecuteBackgroundLoop(String name);

    /**
     * Invoked once a {@link BackgroundLoop} completed it's work.
     *
     * @param name          the name of the background loop
     * @param executionInfo some info about the last execution
     */
    void backgroundLoopCompleted(String name, String executionInfo);

    /**
     * Determines if a daily task should be executed.
     *
     * @param name the name of the task
     * @return true if the task should be executed, false otherwise
     */
    boolean shouldRunDailyTask(String name);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy