/
VertxInstance.java
42 lines (37 loc) · 1.29 KB
/
VertxInstance.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/* Hibernate, Relational Persistence for Idiomatic Java
*
* SPDX-License-Identifier: Apache-2.0
* Copyright: Red Hat Inc. and Hibernate Authors
*/
package org.hibernate.reactive.vertx;
import io.vertx.core.Vertx;
import org.hibernate.reactive.pool.impl.DefaultSqlClientPool;
import org.hibernate.service.Service;
/**
* Used by {@link DefaultSqlClientPool} and
* {@link org.hibernate.reactive.context.impl.VertxContext}
* to obtain an instance of {@link Vertx}. The default instance is
* {@link org.hibernate.reactive.vertx.impl.DefaultVertxInstance}.
* <p>
* A program may integrate a custom {@link VertxInstance}
* with Hibernate Reactive by contributing a new service using a
* {@link org.hibernate.boot.registry.StandardServiceInitiator}
* or from code-based Hibernate configuration by calling
* {@link org.hibernate.reactive.provider.ReactiveServiceRegistryBuilder#addService}.
*
* <pre>{@code
* new ReactiveServiceRegistryBuilder()
* .applySettings( properties )
* .addService( VertxInstance.class, (VertxInstance) () -> myVertx )
* .build();
* }</pre>
*
* @see org.hibernate.reactive.vertx.impl.ProvidedVertxInstance
*/
@FunctionalInterface
public interface VertxInstance extends Service {
/**
* Obtain the instance of {@link Vertx}.
*/
Vertx getVertx();
}