Skip to content

Commit

Permalink
Vertx: add priority to the SafeVertxContextInterceptor
Browse files Browse the repository at this point in the history
- also move the SafeVertxContext binding to the io.quarkus.vertx package
because io.quarkus.vertx.core.runtime.context should not be considered
part of the public API
- fixes quarkusio#35173
  • Loading branch information
mkouba committed Aug 4, 2023
1 parent 6e65c47 commit 25aeaac
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/src/main/asciidoc/duplicated-context.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ context can have spans in which it's safe, followed by spans in which it's not s

To mark a context as safe, you can:

1. Use the `io.quarkus.vertx.core.runtime.context.SafeVertxContext` annotation
1. Use the `io.quarkus.vertx.SafeVertxContext` annotation
2. Use the `io.quarkus.vertx.core.runtime.context.VertxContextSafetyToggle` class

By using the `io.quarkus.vertx.core.runtime.context.VertxContextSafetyToggle` class, the current context can be explicitly marked as `safe`, or it can be explicitly marked as `unsafe`; there's a third state which is the default of any new context: `unmarked`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.test.QuarkusUnitTest;
import io.quarkus.vertx.core.runtime.context.SafeVertxContext;
import io.quarkus.vertx.SafeVertxContext;
import io.quarkus.vertx.core.runtime.context.VertxContextSafetyToggle;
import io.smallrye.common.vertx.VertxContext;
import io.vertx.core.Context;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.vertx.core.runtime.context;
package io.quarkus.vertx;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
package io.quarkus.vertx.core.runtime.context;

import static jakarta.interceptor.Interceptor.Priority.PLATFORM_BEFORE;

import jakarta.annotation.Priority;
import jakarta.inject.Inject;
import jakarta.interceptor.AroundInvoke;
import jakarta.interceptor.Interceptor;

import org.jboss.logging.Logger;

import io.quarkus.arc.ArcInvocationContext;
import io.quarkus.vertx.SafeVertxContext;
import io.vertx.core.Vertx;

@SafeVertxContext
@Priority(PLATFORM_BEFORE)
@Interceptor
public class SafeVertxContextInterceptor {

Expand Down

0 comments on commit 25aeaac

Please sign in to comment.