Package io.smallrye.context
Class SmallRyeContextManager.Builder
- java.lang.Object
-
- io.smallrye.context.SmallRyeContextManager.Builder
-
- All Implemented Interfaces:
org.eclipse.microprofile.context.spi.ContextManager.Builder
- Enclosing class:
- SmallRyeContextManager
public static class SmallRyeContextManager.Builder extends Object implements org.eclipse.microprofile.context.spi.ContextManager.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
withThreadContextProviders
public SmallRyeContextManager.Builder withThreadContextProviders(org.eclipse.microprofile.context.spi.ThreadContextProvider... providers)
- Specified by:
withThreadContextProvidersin interfaceorg.eclipse.microprofile.context.spi.ContextManager.Builder
-
addDiscoveredThreadContextProviders
public SmallRyeContextManager.Builder addDiscoveredThreadContextProviders()
- Specified by:
addDiscoveredThreadContextProvidersin interfaceorg.eclipse.microprofile.context.spi.ContextManager.Builder
-
withContextManagerExtensions
public SmallRyeContextManager.Builder withContextManagerExtensions(org.eclipse.microprofile.context.spi.ContextManagerExtension... propagators)
- Specified by:
withContextManagerExtensionsin interfaceorg.eclipse.microprofile.context.spi.ContextManager.Builder
-
addDiscoveredContextManagerExtensions
public SmallRyeContextManager.Builder addDiscoveredContextManagerExtensions()
- Specified by:
addDiscoveredContextManagerExtensionsin interfaceorg.eclipse.microprofile.context.spi.ContextManager.Builder
-
forClassLoader
public SmallRyeContextManager.Builder forClassLoader(ClassLoader classLoader)
- Specified by:
forClassLoaderin interfaceorg.eclipse.microprofile.context.spi.ContextManager.Builder
-
build
public SmallRyeContextManager build()
- Specified by:
buildin interfaceorg.eclipse.microprofile.context.spi.ContextManager.Builder
-
registerOnProvider
public SmallRyeContextManager.Builder registerOnProvider()
Registers the built instance to the currentSmallRyeContextManagerProviderbefore any extensions are loaded. This is useful because the extensions might require the builtSmallRyeContextManagerto be registered on the current class loader in order to use it, so this prevents building two.- Returns:
- this builder
-
withDefaultExecutorService
public SmallRyeContextManager.Builder withDefaultExecutorService(ExecutorService executorService)
Make all createdSmallRyeManagedExecutorforward to the given executor service by default instead of creating new executor services to back them. This can be overridden withSmallRyeManagedExecutor.Builder.withExecutorService(ExecutorService)andSmallRyeManagedExecutor.Builder.withNewExecutorService(). Also serves as the default executor to use by allCompletionStageandCompletableFuturewrapped byThreadContext.- Specified by:
withDefaultExecutorServicein interfaceorg.eclipse.microprofile.context.spi.ContextManager.Builder- Parameters:
executorService- the executor service to delegate to. Ifnull, all createdManagedExecutorwill create new backing executor services, and all*Asyncmethods of theCompletionStageandCompletableFuturewrapped byThreadContextwill throw due to a lack of executor.- Returns:
- this builder.
-
enableFastThreadContextProviders
public SmallRyeContextManager.Builder enableFastThreadContextProviders(boolean enable)
Enable or disable FastThreadContextProviders optimisations. Defaults to enabled.- Parameters:
enable- set to false to disable FastThreadContextProviders.- Returns:
- this builder.
-
-