Class CheckingVertxContext

  • All Implemented Interfaces:
    Serializable, Executor, org.hibernate.reactive.context.Context, org.hibernate.service.Service, org.hibernate.service.spi.ServiceRegistryAwareService

    public final class CheckingVertxContext
    extends org.hibernate.reactive.context.impl.VertxContext
    The VertxContext in Hibernate Reactive is accessing the Vert.x context directly, assuming this is the correct context as intended by the developer, as Hibernate Reactive has no opinion in regards to how Vert.x is integrated with other components. The precise definition of "correct context" will most likely depend on the runtime model and how other components are integrated with Vert.x; in particular the lifecycle of the context needs to be specified. For example in Quarkus's RestEasy Reactive we ensure that each request will run on a separate context; this ensures operations relating to different web requests are isolated among each other. To ensure that Quarkus users are using Hibernate Reactive on a context which is compatible with its expectations, this alternative implementation of VertxContext actually checks on each context access if it's safe to use by invoking VertxContextSafetyToggle.validateContextIfExists(String, String).
    See Also:
    VertxContextSafetyToggle, Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.hibernate.reactive.context.Context

        org.hibernate.reactive.context.Context.Key<T extends Object>
    • Constructor Detail

      • CheckingVertxContext

        public CheckingVertxContext()
    • Method Detail

      • put

        public <T> void put​(org.hibernate.reactive.context.Context.Key<T> key,
                            T instance)
        Specified by:
        put in interface org.hibernate.reactive.context.Context
        Overrides:
        put in class org.hibernate.reactive.context.impl.VertxContext
      • get

        public <T> T get​(org.hibernate.reactive.context.Context.Key<T> key)
        Specified by:
        get in interface org.hibernate.reactive.context.Context
        Overrides:
        get in class org.hibernate.reactive.context.impl.VertxContext
      • remove

        public void remove​(org.hibernate.reactive.context.Context.Key<?> key)
        Specified by:
        remove in interface org.hibernate.reactive.context.Context
        Overrides:
        remove in class org.hibernate.reactive.context.impl.VertxContext