Class StandaloneFaultTolerance
java.lang.Object
io.smallrye.faulttolerance.standalone.StandaloneFaultTolerance
Integration point for standalone usage of SmallRye Fault Tolerance. Allows custom configuration
and shutting down the supporting infrastructure.
The configure() method accepts an implementation of
the Configuration interface. It must be called before the first use of SmallRye
Fault Tolerance, and it may only be called once.
The shutdown() method should be called during application shutdown, when SmallRye
Fault Tolerance is not supposed to be used anymore. It shuts down all internally created
resources (such as a timer) and then calls Configuration.onShutdown(). SmallRye
Fault Tolerance must not be used after shutdown() is called.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidconfigure(Configuration configuration) Makes sure that the givenconfigurationis used by SmallRye Fault Tolerance.static voidshutdown()Asks SmallRye Fault Tolerance to shut down.static TimerAccessDeprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
StandaloneFaultTolerance
public StandaloneFaultTolerance()
-
-
Method Details
-
configure
Makes sure that the givenconfigurationis used by SmallRye Fault Tolerance. Throws an exception when configuration was already set or when SmallRye Fault Tolerance has already read the configuration and reconfiguration is not possible.- Parameters:
configuration- customConfigurationimplementation, must not benull
-
timerAccess
Deprecated, for removal: This API element is subject to removal in a future version.Provides access to the timer that SmallRye Fault Tolernce internally uses for scheduling purposes. It provides a read-only view into what the timer is doing.- Returns:
- read-only view into the SmallRye Fault Tolerance timer
-
shutdown
Asks SmallRye Fault Tolerance to shut down. If custom configuration was provided usingconfigure(), theConfiguration.onShutdown()method is called as the last step.After this method is called, no thread may use the SmallRye Fault Tolerance API.
- Throws:
InterruptedException- when the shutdown process is interrupted
-