java.lang.Object
org.firebirdsql.gds.ng.jna.AbstractNativeDatabaseFactory
- All Implemented Interfaces:
org.firebirdsql.gds.ng.FbDatabaseFactory
- Direct Known Subclasses:
FbClientDatabaseFactory
,FbEmbeddedDatabaseFactory
public abstract class AbstractNativeDatabaseFactory
extends Object
implements org.firebirdsql.gds.ng.FbDatabaseFactory
Common implementation for client library and embedded database factory.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconnect
(org.firebirdsql.gds.ng.IConnectionProperties connectionProperties) protected abstract FbClientLibrary
Creates and initialize a new instance of the client library.protected abstract Collection<String>
protected <T extends org.firebirdsql.gds.ng.IAttachProperties<T>>
TfilterProperties
(T attachProperties) Allows the database factory to perform modification of the attach properties before use.protected FbClientLibrary
Gets the current instance of the client library.serviceConnect
(org.firebirdsql.gds.ng.IServiceProperties serviceProperties)
-
Constructor Details
-
AbstractNativeDatabaseFactory
public AbstractNativeDatabaseFactory()
-
-
Method Details
-
connect
public JnaDatabase connect(org.firebirdsql.gds.ng.IConnectionProperties connectionProperties) throws SQLException - Specified by:
connect
in interfaceorg.firebirdsql.gds.ng.FbDatabaseFactory
- Throws:
SQLException
-
serviceConnect
public JnaService serviceConnect(org.firebirdsql.gds.ng.IServiceProperties serviceProperties) throws SQLException - Specified by:
serviceConnect
in interfaceorg.firebirdsql.gds.ng.FbDatabaseFactory
- Throws:
SQLException
-
getClientLibrary
Gets the current instance of the client library.Most implementations should not override this method (contrary to previous versions of Jaybird), to ensure native libraries are properly disposed of.
- Returns:
- Client library instance.
-
createClientLibrary
Creates and initialize a new instance of the client library.Instances should not be cached (caching - if any - is the responsibility of the caller).
- Returns:
- new client library instance
- Since:
- 4.0
-
filterProperties
protected <T extends org.firebirdsql.gds.ng.IAttachProperties<T>> T filterProperties(T attachProperties) Allows the database factory to perform modification of the attach properties before use.Implementations should be prepared to handle immutable attach properties. Implementations are strongly advised to copy the attach properties before modification and return this copy.
- Type Parameters:
T
- Type of attach properties- Parameters:
attachProperties
- Attach properties- Returns:
- Filtered properties
-
defaultLibraryNames
- Returns:
- the default library names loaded by this factory
-