Class ProvidedVertxInstance

java.lang.Object
org.hibernate.reactive.vertx.impl.ProvidedVertxInstance
All Implemented Interfaces:
Serializable, VertxInstance, org.hibernate.service.Service

public final class ProvidedVertxInstance extends Object implements VertxInstance
An implementation of VertxInstance which allows the client to provide an instance of Vertx whose lifecycle is managed externally to Hibernate Reactive. The ProvidedVertxInstance must be registered explicitly with Hibernate by calling StandardServiceRegistryBuilder.addService(java.lang.Class<T>, T).

Hibernate Reactive won't stop the Vert.x instance at shutdown.

 new ReactiveServiceRegistryBuilder()
     .applySettings( properties )
     .addService( VertxInstance.class, new ProvidedVertxInstance( vertx ) )
     .build();
 
See Also:
  • Constructor Details

    • ProvidedVertxInstance

      public ProvidedVertxInstance(io.vertx.core.Vertx vertx)
  • Method Details

    • getVertx

      public io.vertx.core.Vertx getVertx()
      Description copied from interface: VertxInstance
      Obtain the instance of Vertx.
      Specified by:
      getVertx in interface VertxInstance