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

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

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

import java.util.function.Function;

/**
 * An abstract base for both {@link RunOptions} and {@link TransactionRunnerImpl}.
 * 

* Necessary because having {@link RunOptions} extend {@link TransactionRunnerImpl}., * or the other way around, results in signature conflicts in {@code exceptionHandler(Function)}. */ class RunOptionsBase { TransactionSemantics semantics = TransactionSemantics.REQUIRE_NEW; int timeout = 0; Function exceptionHandler; RunOptionsBase setTimeout(int seconds) { if (seconds < 0) { throw new IllegalArgumentException("seconds cannot be negative"); } this.timeout = seconds; return this; } RunOptionsBase setSemantics(TransactionSemantics semantics) { this.semantics = semantics; return this; } RunOptionsBase setExceptionHandler(Function handler) { this.exceptionHandler = handler; return this; } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy