Interface ThreadPoolBulkheadRegistry
- All Superinterfaces:
java.lang.AutoCloseable
,io.github.resilience4j.core.Registry<ThreadPoolBulkhead,ThreadPoolBulkheadConfig>
- All Known Implementing Classes:
InMemoryThreadPoolBulkheadRegistry
public interface ThreadPoolBulkheadRegistry extends io.github.resilience4j.core.Registry<ThreadPoolBulkhead,ThreadPoolBulkheadConfig>, java.lang.AutoCloseable
ThreadPoolBulkheadRegistry
is a factory to create ThreadPoolBulkhead instances which
stores all bulkhead instances in a registry.-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ThreadPoolBulkheadRegistry.Builder
-
Method Summary
Modifier and Type Method Description ThreadPoolBulkhead
bulkhead(java.lang.String name)
Returns a managedThreadPoolBulkhead
or creates a new one with default configuration.ThreadPoolBulkhead
bulkhead(java.lang.String name, ThreadPoolBulkheadConfig config)
Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.ThreadPoolBulkhead
bulkhead(java.lang.String name, ThreadPoolBulkheadConfig config, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.ThreadPoolBulkhead
bulkhead(java.lang.String name, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedThreadPoolBulkhead
or creates a new one with default configuration.ThreadPoolBulkhead
bulkhead(java.lang.String name, java.lang.String configName)
Returns a managedThreadPoolBulkhead
or creates a new one.ThreadPoolBulkhead
bulkhead(java.lang.String name, java.lang.String configName, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedThreadPoolBulkhead
or creates a new one.ThreadPoolBulkhead
bulkhead(java.lang.String name, java.util.function.Supplier<ThreadPoolBulkheadConfig> bulkheadConfigSupplier)
Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.ThreadPoolBulkhead
bulkhead(java.lang.String name, java.util.function.Supplier<ThreadPoolBulkheadConfig> bulkheadConfigSupplier, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.static ThreadPoolBulkheadRegistry.Builder
custom()
Returns a builder to create a custom ThreadPoolBulkheadRegistry.io.vavr.collection.Seq<ThreadPoolBulkhead>
getAllBulkheads()
Returns all managedThreadPoolBulkhead
instances.static ThreadPoolBulkheadRegistry
of(ThreadPoolBulkheadConfig bulkheadConfig)
Creates a BulkheadRegistry with a custom Bulkhead configuration.static ThreadPoolBulkheadRegistry
of(ThreadPoolBulkheadConfig bulkheadConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead> registryEventConsumer)
Creates a ThreadPoolBulkheadRegistry with a custom default ThreadPoolBulkhead configuration and a ThreadPoolBulkhead registry event consumer.static ThreadPoolBulkheadRegistry
of(ThreadPoolBulkheadConfig bulkheadConfig, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead>> registryEventConsumers)
Creates a ThreadPoolBulkheadRegistry with a custom default ThreadPoolBulkhead configuration and a list of ThreadPoolBulkhead registry event consumers.static ThreadPoolBulkheadRegistry
of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs)
Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations.static ThreadPoolBulkheadRegistry
of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead> registryEventConsumer)
Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a ThreadPoolBulkhead registry event consumer.static ThreadPoolBulkheadRegistry
of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead> registryEventConsumer, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a ThreadPoolBulkhead registry event consumer.static ThreadPoolBulkheadRegistry
of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations.static ThreadPoolBulkheadRegistry
of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead>> registryEventConsumers)
Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a list of ThreadPoolBulkhead registry event consumers.static ThreadPoolBulkheadRegistry
of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead>> registryEventConsumers, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a list of ThreadPoolBulkhead registry event consumers.static ThreadPoolBulkheadRegistry
ofDefaults()
Creates a ThreadPoolBulkheadRegistry with a default ThreadPoolBulkhead configurationstatic ThreadPoolBulkheadRegistry
ofDefaults(io.vavr.collection.Map<java.lang.String,java.lang.String> tags)
Creates a ThreadPoolBulkheadRegistry with a default ThreadPoolBulkhead configuration
-
Method Details
-
of
Creates a BulkheadRegistry with a custom Bulkhead configuration.- Parameters:
bulkheadConfig
- a custom ThreadPoolBulkhead configuration- Returns:
- a ThreadPoolBulkheadRegistry instance backed by a custom ThreadPoolBulkhead configuration
-
of
static ThreadPoolBulkheadRegistry of(ThreadPoolBulkheadConfig bulkheadConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead> registryEventConsumer)Creates a ThreadPoolBulkheadRegistry with a custom default ThreadPoolBulkhead configuration and a ThreadPoolBulkhead registry event consumer.- Parameters:
bulkheadConfig
- a custom default ThreadPoolBulkhead configuration.registryEventConsumer
- a ThreadPoolBulkhead registry event consumer.- Returns:
- a ThreadPoolBulkheadRegistry with a custom ThreadPoolBulkhead configuration and a ThreadPoolBulkhead registry event consumer.
-
of
static ThreadPoolBulkheadRegistry of(ThreadPoolBulkheadConfig bulkheadConfig, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead>> registryEventConsumers)Creates a ThreadPoolBulkheadRegistry with a custom default ThreadPoolBulkhead configuration and a list of ThreadPoolBulkhead registry event consumers.- Parameters:
bulkheadConfig
- a custom default ThreadPoolBulkhead configuration.registryEventConsumers
- a list of ThreadPoolBulkhead registry event consumers.- Returns:
- a ThreadPoolBulkheadRegistry with a custom ThreadPoolBulkhead configuration and a list of ThreadPoolBulkhead registry event consumers.
-
ofDefaults
Creates a ThreadPoolBulkheadRegistry with a default ThreadPoolBulkhead configuration- Returns:
- a ThreadPoolBulkheadRegistry instance backed by a default ThreadPoolBulkhead configuration
-
ofDefaults
static ThreadPoolBulkheadRegistry ofDefaults(io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Creates a ThreadPoolBulkheadRegistry with a default ThreadPoolBulkhead configurationTags added to the registry will be added to every instance created by this registry.
- Parameters:
tags
- default tags to add to the registry- Returns:
- a ThreadPoolBulkheadRegistry instance backed by a default ThreadPoolBulkhead configuration
-
of
static ThreadPoolBulkheadRegistry of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs)Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations.- Parameters:
configs
- a Map of shared Bulkhead configurations- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations.
-
of
static ThreadPoolBulkheadRegistry of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations.Tags added to the registry will be added to every instance created by this registry.
- Parameters:
configs
- a Map of shared Bulkhead configurationstags
- default tags to add to the registry- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations.
-
of
static ThreadPoolBulkheadRegistry of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead> registryEventConsumer)Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a ThreadPoolBulkhead registry event consumer.- Parameters:
configs
- a Map of shared ThreadPoolBulkhead configurations.registryEventConsumer
- a ThreadPoolBulkhead registry event consumer.- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a ThreadPoolBulkhead registry event consumer.
-
of
static ThreadPoolBulkheadRegistry of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead> registryEventConsumer, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a ThreadPoolBulkhead registry event consumer.Tags added to the registry will be added to every instance created by this registry.
- Parameters:
configs
- a Map of shared ThreadPoolBulkhead configurations.registryEventConsumer
- a ThreadPoolBulkhead registry event consumer.tags
- default tags to add to the registry- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a ThreadPoolBulkhead registry event consumer.
-
of
static ThreadPoolBulkheadRegistry of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead>> registryEventConsumers)Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a list of ThreadPoolBulkhead registry event consumers.- Parameters:
configs
- a Map of shared ThreadPoolBulkhead configurations.registryEventConsumers
- a list of ThreadPoolBulkhead registry event consumers.- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a list of ThreadPoolBulkhead registry event consumers.
-
of
static ThreadPoolBulkheadRegistry of(java.util.Map<java.lang.String,ThreadPoolBulkheadConfig> configs, java.util.List<io.github.resilience4j.core.registry.RegistryEventConsumer<ThreadPoolBulkhead>> registryEventConsumers, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Creates a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a list of ThreadPoolBulkhead registry event consumers.Tags added to the registry will be added to every instance created by this registry.
- Parameters:
configs
- a Map of shared ThreadPoolBulkhead configurations.registryEventConsumers
- a list of ThreadPoolBulkhead registry event consumers.tags
- Tags to add to the ThreadPoolBulkhead- Returns:
- a ThreadPoolBulkheadRegistry with a Map of shared ThreadPoolBulkhead configurations and a list of ThreadPoolBulkhead registry event consumers.
-
getAllBulkheads
io.vavr.collection.Seq<ThreadPoolBulkhead> getAllBulkheads()Returns all managedThreadPoolBulkhead
instances.- Returns:
- all managed
ThreadPoolBulkhead
instances.
-
bulkhead
Returns a managedThreadPoolBulkhead
or creates a new one with default configuration.- Parameters:
name
- the name of the ThreadPoolBulkhead- Returns:
- The
ThreadPoolBulkhead
-
bulkhead
ThreadPoolBulkhead bulkhead(java.lang.String name, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedThreadPoolBulkhead
or creates a new one with default configuration.- Parameters:
name
- the name of the ThreadPoolBulkheadtags
- Tags to add to the ThreadPoolBulkhead- Returns:
- The
ThreadPoolBulkhead
-
bulkhead
Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.- Parameters:
name
- the name of the ThreadPoolBulkheadconfig
- a custom ThreadPoolBulkheadConfig configuration- Returns:
- The
ThreadPoolBulkhead
-
bulkhead
ThreadPoolBulkhead bulkhead(java.lang.String name, ThreadPoolBulkheadConfig config, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.The
tags
passed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name
- the name of the ThreadPoolBulkheadconfig
- a custom ThreadPoolBulkheadConfig configurationtags
- tags to add to the ThreadPoolBulkhead- Returns:
- The
ThreadPoolBulkhead
-
bulkhead
ThreadPoolBulkhead bulkhead(java.lang.String name, java.util.function.Supplier<ThreadPoolBulkheadConfig> bulkheadConfigSupplier)Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.- Parameters:
name
- the name of the ThreadPoolBulkheadbulkheadConfigSupplier
- a custom ThreadPoolBulkhead configuration supplier- Returns:
- The
ThreadPoolBulkhead
-
bulkhead
ThreadPoolBulkhead bulkhead(java.lang.String name, java.util.function.Supplier<ThreadPoolBulkheadConfig> bulkheadConfigSupplier, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedThreadPoolBulkhead
or creates a new one with a custom ThreadPoolBulkhead configuration.The
tags
passed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name
- the name of the ThreadPoolBulkheadbulkheadConfigSupplier
- a custom ThreadPoolBulkhead configuration suppliertags
- tags to add to the ThreadPoolBulkhead- Returns:
- The
ThreadPoolBulkhead
-
bulkhead
Returns a managedThreadPoolBulkhead
or creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object)
.- Parameters:
name
- the name of the ThreadPoolBulkheadconfigName
- the name of the shared configuration- Returns:
- The
ThreadPoolBulkhead
-
bulkhead
ThreadPoolBulkhead bulkhead(java.lang.String name, java.lang.String configName, io.vavr.collection.Map<java.lang.String,java.lang.String> tags)Returns a managedThreadPoolBulkhead
or creates a new one. The configuration must have been added upfront viaRegistry.addConfiguration(String, Object)
.The
tags
passed will be appended to the tags already configured for the registry. When tags (keys) of the two collide the tags passed with this method will override the tags of the registry.- Parameters:
name
- the name of the ThreadPoolBulkheadconfigName
- the name of the shared configurationtags
- tags to add to the ThreadPoolBulkhead- Returns:
- The
ThreadPoolBulkhead
-
custom
Returns a builder to create a custom ThreadPoolBulkheadRegistry.- Returns:
- a
ThreadPoolBulkheadRegistry.Builder
-