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

io.quarkus.narayana.jta.TransactionRunnerImpl Maven / Gradle / Ivy

There is a newer version: 3.17.0
Show newest version
package io.quarkus.narayana.jta;

import java.util.concurrent.Callable;
import java.util.function.Function;

class TransactionRunnerImpl extends RunOptionsBase
        implements TransactionRunnerOptions, TransactionRunner {
    TransactionRunnerImpl(TransactionSemantics semantics) {
        setSemantics(semantics);
    }

    @Override
    public TransactionRunnerImpl timeout(int seconds) {
        setTimeout(seconds);
        return this;
    }

    @Override
    public TransactionRunnerImpl exceptionHandler(Function handler) {
        setExceptionHandler(handler);
        return this;
    }

    @Override
    public void run(Runnable task) {
        QuarkusTransactionImpl.call(this, () -> {
            task.run();
            return null;
        });
    }

    @Override
    public  T call(Callable task) {
        return QuarkusTransactionImpl.call(this, task);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy