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
The ThreadPoolBulkheadRegistry is a factory to create ThreadPoolBulkhead instances which stores all bulkhead instances in a registry.
  • 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

      static ThreadPoolBulkheadRegistry 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 configuration

      Tags 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 configurations
      tags - 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 managed ThreadPoolBulkhead instances.
      Returns:
      all managed ThreadPoolBulkhead instances.
    • bulkhead

      ThreadPoolBulkhead bulkhead​(java.lang.String name)
      Returns a managed ThreadPoolBulkhead 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 managed ThreadPoolBulkhead or creates a new one with default configuration.
      Parameters:
      name - the name of the ThreadPoolBulkhead
      tags - Tags to add to the ThreadPoolBulkhead
      Returns:
      The ThreadPoolBulkhead
    • bulkhead

      ThreadPoolBulkhead bulkhead​(java.lang.String name, ThreadPoolBulkheadConfig config)
      Returns a managed ThreadPoolBulkhead or creates a new one with a custom ThreadPoolBulkhead configuration.
      Parameters:
      name - the name of the ThreadPoolBulkhead
      config - 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 managed ThreadPoolBulkhead 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 ThreadPoolBulkhead
      config - a custom ThreadPoolBulkheadConfig configuration
      tags - tags to add to the ThreadPoolBulkhead
      Returns:
      The ThreadPoolBulkhead
    • bulkhead

      ThreadPoolBulkhead bulkhead​(java.lang.String name, java.util.function.Supplier<ThreadPoolBulkheadConfig> bulkheadConfigSupplier)
      Returns a managed ThreadPoolBulkhead or creates a new one with a custom ThreadPoolBulkhead configuration.
      Parameters:
      name - the name of the ThreadPoolBulkhead
      bulkheadConfigSupplier - 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 managed ThreadPoolBulkhead 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 ThreadPoolBulkhead
      bulkheadConfigSupplier - a custom ThreadPoolBulkhead configuration supplier
      tags - tags to add to the ThreadPoolBulkhead
      Returns:
      The ThreadPoolBulkhead
    • bulkhead

      ThreadPoolBulkhead bulkhead​(java.lang.String name, java.lang.String configName)
      Returns a managed ThreadPoolBulkhead or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).
      Parameters:
      name - the name of the ThreadPoolBulkhead
      configName - 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 managed ThreadPoolBulkhead or creates a new one. The configuration must have been added upfront via Registry.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 ThreadPoolBulkhead
      configName - the name of the shared configuration
      tags - tags to add to the ThreadPoolBulkhead
      Returns:
      The ThreadPoolBulkhead
    • custom

      Returns a builder to create a custom ThreadPoolBulkheadRegistry.
      Returns:
      a ThreadPoolBulkheadRegistry.Builder