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

com.van.logging.IFlushAndPublish Maven / Gradle / Ivy

There is a newer version: 5.5.0
Show newest version
package com.van.logging;

import java.util.concurrent.Future;

/**
 * An interface for an implementation that will flush and publish
 * cached content.
 */
public interface IFlushAndPublish {
    /**
     * Flush and publish cached content and return a Future <Boolean>
     * for the result.
     *
     * @return Future <Boolean> for the result. This CAN BE
     * null if there was nothing published.
     */
    default Future flushAndPublish() {
        return this.flushAndPublish(false);
    }

    /**
     * Flush and publish cached content and return a Future <Boolean>
     * for the result.
     *
     * @param useCurrentThread: if True, publish using the current thread instead of a background thread. This should
     *     not be true in normal cases. One case where it should be true is when called from the shutdown hook.
     *
     * @return Future <Boolean> for the result. This CAN BE
     * null if there was nothing published.
     */
    public Future flushAndPublish(boolean useCurrentThread);
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy