Interface ConnectionCapabilities
- All Superinterfaces:
io.micronaut.core.order.Ordered
public interface ConnectionCapabilities
extends io.micronaut.core.order.Ordered
Defines the capabilities of a
Connection.
You can provide your own implementation via Java SPI by registering
io.micronaut.data.connection.ConnectionCapabilities in
META-INF/services/io.micronaut.data.connection.ConnectionCapabilities.
Implementations are expected to be thread-safe and preferably stateless because
INSTANCE is a JVM-wide singleton that may be used concurrently.
When multiple SPI providers are present, the one with the lowest order value
(highest precedence, as defined by Ordered) is selected.
- Since:
- 5.0.0
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumConnection capability. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConnectionCapabilitiesThe defaultConnectionCapabilitiesinstance.Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Method Summary
Modifier and TypeMethodDescriptionbooleansupports(ConnectionCapabilities.Capability capability, Connection connection) Determines whether the given JDBC connection supports the requested capability.Methods inherited from interface io.micronaut.core.order.Ordered
getOrder
-
Field Details
-
INSTANCE
The defaultConnectionCapabilitiesinstance. This is a JVM-wide singleton and may be accessed concurrently. When multiple SPI providers are found, the one with the lowest order value (highest precedence) is selected.
-
-
Method Details
-
supports
Determines whether the given JDBC connection supports the requested capability.- Parameters:
capability- The capability to evaluateconnection- The JDBC connection- Returns:
trueif the connection supports the capability;falseotherwise
-