diff --git a/docs/src/main/asciidoc/cdi-integration.adoc b/docs/src/main/asciidoc/cdi-integration.adoc index b8730640860ca9..3722a80fd43755 100644 --- a/docs/src/main/asciidoc/cdi-integration.adoc +++ b/docs/src/main/asciidoc/cdi-integration.adoc @@ -486,7 +486,9 @@ IMPORTANT: A build step that consumes the `ContextRegistrationPhaseBuildItem` sh ---- @BuildStep ContextConfiguratorBuildItem registerContext(ContextRegistrationPhaseBuildItem phase) { - return new ContextConfiguratorBuildItem(phase.getContext().configure(TransactionScoped.class).normal().contextClass(TransactionContext.class)); + ContextConfigurator configurator = phase.getContext().configure(TransactionScoped.class); + configurator.normal().contextClass(TransactionContext.class).done(); + return new ContextConfiguratorBuildItem(configurator); } ---- diff --git a/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java b/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java index e34a05a00bc056..f90cc5c443b9a8 100644 --- a/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java +++ b/extensions/narayana-jta/deployment/src/main/java/io/quarkus/narayana/jta/deployment/NarayanaJtaProcessor.java @@ -37,6 +37,7 @@ import io.quarkus.arc.deployment.GeneratedBeanBuildItem; import io.quarkus.arc.deployment.GeneratedBeanGizmoAdaptor; import io.quarkus.arc.deployment.UnremovableBeanBuildItem; +import io.quarkus.arc.processor.ContextConfigurator; import io.quarkus.deployment.Feature; import io.quarkus.deployment.IsTest; import io.quarkus.deployment.annotations.BuildProducer; @@ -155,8 +156,16 @@ void testTx(BuildProducer generatedBeanBuildItemBuildPro @BuildStep public ContextConfiguratorBuildItem transactionContext(ContextRegistrationPhaseBuildItem contextRegistrationPhase) { - return new ContextConfiguratorBuildItem(contextRegistrationPhase.getContext() - .configure(TransactionScoped.class).normal().contextClass(TransactionContext.class)); + ContextConfigurator configurator = contextRegistrationPhase.getContext().configure(TransactionScoped.class); + configurator.normal().contextClass(TransactionContext.class).done(); + return new ContextConfiguratorBuildItem(configurator); + } + + @BuildStep + ContextConfiguratorBuildItem registerContext(ContextRegistrationPhaseBuildItem phase) { + ContextConfigurator configurator = phase.getContext().configure(TransactionScoped.class); + configurator.normal().contextClass(TransactionContext.class).done(); + return new ContextConfiguratorBuildItem(configurator); } @BuildStep diff --git a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java index 06fd8dd5d71698..571a2eaf723591 100644 --- a/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java +++ b/extensions/undertow/deployment/src/main/java/io/quarkus/undertow/deployment/UndertowBuildStep.java @@ -87,6 +87,7 @@ import io.quarkus.arc.deployment.CustomScopeBuildItem; import io.quarkus.arc.deployment.SyntheticBeanBuildItem; import io.quarkus.arc.processor.AnnotationsTransformer; +import io.quarkus.arc.processor.ContextConfigurator; import io.quarkus.deployment.Capabilities; import io.quarkus.deployment.Capability; import io.quarkus.deployment.Feature; @@ -221,8 +222,9 @@ void integrateCdi(BuildProducer additionalBeans, @BuildStep ContextConfiguratorBuildItem registerContext(ContextRegistrationPhaseBuildItem phase) { - return new ContextConfiguratorBuildItem( - phase.getContext().configure(SessionScoped.class).normal().contextClass(HttpSessionContext.class)); + ContextConfigurator configurator = phase.getContext().configure(SessionScoped.class); + configurator.normal().contextClass(HttpSessionContext.class).done(); + return new ContextConfiguratorBuildItem(configurator); } @BuildStep