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 Classes
    Modifier and Type
    Interface
    Description
    static enum 
    Connection capability.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The default ConnectionCapabilities instance.

    Fields inherited from interface io.micronaut.core.order.Ordered

    HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Determines whether the given JDBC connection supports the requested capability.

    Methods inherited from interface io.micronaut.core.order.Ordered

    getOrder
  • Field Details

    • INSTANCE

      static final ConnectionCapabilities INSTANCE
      The default ConnectionCapabilities instance. 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

      boolean supports(ConnectionCapabilities.Capability capability, Connection connection)
      Determines whether the given JDBC connection supports the requested capability.
      Parameters:
      capability - The capability to evaluate
      connection - The JDBC connection
      Returns:
      true if the connection supports the capability; false otherwise