Class InMemoryBulkheadRegistry

java.lang.Object
io.github.resilience4j.core.registry.AbstractRegistry<Bulkhead,BulkheadConfig>
io.github.resilience4j.bulkhead.internal.InMemoryBulkheadRegistry
All Implemented Interfaces:
BulkheadRegistry, io.github.resilience4j.core.Registry<Bulkhead,BulkheadConfig>

public final class InMemoryBulkheadRegistry extends io.github.resilience4j.core.registry.AbstractRegistry<Bulkhead,BulkheadConfig> implements BulkheadRegistry
Bulkhead instance manager; Constructs/returns bulkhead instances.
  • Constructor Details

    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry()
      The constructor with default configuration.
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(Map<String,BulkheadConfig> configs)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(Map<String,BulkheadConfig> configs, Map<String,String> tags)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(Map<String,BulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead> registryEventConsumer)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(Map<String,BulkheadConfig> configs, io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead> registryEventConsumer, Map<String,String> tags)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(Map<String,BulkheadConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead>> registryEventConsumers)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(Map<String,BulkheadConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead>> registryEventConsumers, Map<String,String> tags)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(BulkheadConfig defaultConfig)
      The constructor with custom default config.
      Parameters:
      defaultConfig - The default config.
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(BulkheadConfig defaultConfig, Map<String,String> tags)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(BulkheadConfig defaultConfig, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead>> registryEventConsumers)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(BulkheadConfig defaultConfig, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead>> registryEventConsumers, Map<String,String> tags)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(BulkheadConfig defaultConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead> registryEventConsumer)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(BulkheadConfig defaultConfig, io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead> registryEventConsumer, Map<String,String> tags)
    • InMemoryBulkheadRegistry

      public InMemoryBulkheadRegistry(Map<String,BulkheadConfig> configs, List<io.github.resilience4j.core.registry.RegistryEventConsumer<Bulkhead>> registryEventConsumers, Map<String,String> tags, io.github.resilience4j.core.RegistryStore<Bulkhead> registryStore)
  • Method Details

    • getAllBulkheads

      public Set<Bulkhead> getAllBulkheads()
      Returns all managed Bulkhead instances.
      Specified by:
      getAllBulkheads in interface BulkheadRegistry
      Returns:
      all managed Bulkhead instances.
    • bulkhead

      public Bulkhead bulkhead(String name)
      Returns a managed Bulkhead or creates a new one with default configuration.
      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      Returns:
      The Bulkhead
    • bulkhead

      public Bulkhead bulkhead(String name, Map<String,String> tags)
      Returns a managed Bulkhead or creates a new one with default 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.

      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      tags - tags to add to the bulkhead
      Returns:
      The Bulkhead
    • bulkhead

      public Bulkhead bulkhead(String name, BulkheadConfig config)
      Returns a managed Bulkhead or creates a new one with a custom BulkheadConfig configuration.
      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      config - a custom Bulkhead configuration
      Returns:
      The Bulkhead
    • bulkhead

      public Bulkhead bulkhead(String name, BulkheadConfig config, Map<String,String> tags)
      Returns a managed Bulkhead or creates a new one with a custom BulkheadConfig 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.

      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      config - a custom Bulkhead configuration
      tags - tags added to the bulkhead
      Returns:
      The Bulkhead
    • bulkhead

      public Bulkhead bulkhead(String name, Supplier<BulkheadConfig> bulkheadConfigSupplier)
      Returns a managed Bulkhead or creates a new one with a custom Bulkhead configuration.
      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      bulkheadConfigSupplier - a custom Bulkhead configuration supplier
      Returns:
      The Bulkhead
    • bulkhead

      public Bulkhead bulkhead(String name, Supplier<BulkheadConfig> bulkheadConfigSupplier, Map<String,String> tags)
      Returns a managed Bulkhead or creates a new one with a custom Bulkhead 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.

      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      bulkheadConfigSupplier - a custom Bulkhead configuration supplier
      tags - tags to add to the Bulkhead
      Returns:
      The Bulkhead
    • bulkhead

      public Bulkhead bulkhead(String name, String configName)
      Returns a managed Bulkhead or creates a new one. The configuration must have been added upfront via Registry.addConfiguration(String, Object).
      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      configName - the name of the shared configuration
      Returns:
      The Bulkhead
    • bulkhead

      public Bulkhead bulkhead(String name, String configName, Map<String,String> tags)
      Returns a managed Bulkhead 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.

      Specified by:
      bulkhead in interface BulkheadRegistry
      Parameters:
      name - the name of the Bulkhead
      configName - the name of the shared configuration
      tags - tags to add to the Bulkhead
      Returns:
      The Bulkhead