Package dev.failsafe
Class BulkheadBuilder<R>
- java.lang.Object
-
- dev.failsafe.PolicyBuilder<BulkheadBuilder<R>,BulkheadConfig<R>,R>
-
- dev.failsafe.BulkheadBuilder<R>
-
- Type Parameters:
R
- result type
- All Implemented Interfaces:
PolicyListeners<BulkheadBuilder<R>,R>
public class BulkheadBuilder<R> extends PolicyBuilder<BulkheadBuilder<R>,BulkheadConfig<R>,R>
BuildsBulkhead
instances.This class is not threadsafe.
- See Also:
BulkheadConfig
,BulkheadFullException
-
-
Field Summary
-
Fields inherited from class dev.failsafe.PolicyBuilder
config
-
-
Constructor Summary
Constructors Constructor Description BulkheadBuilder(int maxConcurrency)
BulkheadBuilder(BulkheadConfig<R> config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Bulkhead<R>
build()
Builds a newBulkhead
using the builder's configuration.BulkheadBuilder<R>
withMaxWaitTime(java.time.Duration maxWaitTime)
Configures themaxWaitTime
to wait for permits to be available.-
Methods inherited from class dev.failsafe.PolicyBuilder
onFailure, onSuccess
-
-
-
-
Constructor Detail
-
BulkheadBuilder
BulkheadBuilder(int maxConcurrency)
-
BulkheadBuilder
BulkheadBuilder(BulkheadConfig<R> config)
-
-
Method Detail
-
withMaxWaitTime
public BulkheadBuilder<R> withMaxWaitTime(java.time.Duration maxWaitTime)
Configures themaxWaitTime
to wait for permits to be available. If permits cannot be acquired before themaxWaitTime
is exceeded, then the bulkhead will throwBulkheadFullException
.This setting only applies when the resulting Bulkhead is used with the
Failsafe
class. It does not apply when the Bulkhead is used in a standalone way.- Throws:
java.lang.NullPointerException
- ifmaxWaitTime
is null
-
-