Interface FirebirdEmbeddedProvider


  • public interface FirebirdEmbeddedProvider
    Service provider interface to identify a Firebird Embedded library.

    Implementations that provide a Firebird Embedded library need to implement this interface to provide the necessary information to identify if it is a suitable implementation. The implementations of this interface need to be listed in META-INF/services/org.firebirdsql.jna.embedded.spi.FirebirdEmbeddedProvider inside the jar that provides the implementation.

    For detailed requirements, see jdp-2020-05: Firebird Embedded locator service provider

    This class will be loaded using ServiceLoader. Implementations must provide a no-arg constructor.

    Since:
    5
    Author:
    Mark Rotteveel
    • Method Detail

      • getPlatform

        java.lang.String getPlatform()
        Platform of this Firebird Embedded library.

        Applies the platform naming conventions of JNA.

        Returns:
        Name of the platform (e.g. "win32-x86-64" for Windows 64-bit (x86))
      • getVersion

        java.lang.String getVersion()
        Get the Firebird server version of this provider.

        Implementations should report a version similar as reported by isc_info_firebird_version and as expected by GDSServerVersion, that is a format of <platform>-<type><majorVersion>.<minorVersion>.<variant>.<buildNum>[-<revision>] <serverName>, where platform is a two-character platform identification string, Windows for example is "WI", type is one of the three characters: "V" - production version, "T" - beta version, "X" - development version.

        This is not a hard requirement, but failure to comply may exclude the implementation from being used in features like selecting a suitable Firebird Embedded version based on version requirements (such a feature does not exist yet).

        Returns:
        Firebird version information (eg "WI-V3.0.5.33220 Firebird 3.0")
      • getFirebirdEmbeddedLibrary

        FirebirdEmbeddedLibrary getFirebirdEmbeddedLibrary()
                                                    throws FirebirdEmbeddedLoadingException
        Get an instance of the provided Firebird Embedded library.

        For example, implementations could unpack a Firebird Embedded library to the filesystem, or try and find a Firebird instance installed on the system.

        If the provider has to perform initialization before the embedded library is usable (eg copy resources from the classpath to a temporary location), this must be done in this method.

        Implementations must be able to handle multiple calls to this method. It is allowed to return the same library instance on subsequent invocations.

        Returns:
        Firebird Embedded Library information
        Throws:
        FirebirdEmbeddedLoadingException - For exceptions loading or finding Firebird Embedded