Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.ng
Class AbstractConnection<T extends IAttachProperties<T>,C extends FbAttachment>
java.lang.Object
org.firebirdsql.gds.ng.AbstractConnection<T,C>
- Type Parameters:
T
- Type of attach propertiesC
- Type of connection handle
- Direct Known Subclasses:
WireConnection
public abstract class AbstractConnection<T extends IAttachProperties<T>,C extends FbAttachment>
extends Object
Abstract class with common logic for connections.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractConnection
(T attachProperties, IEncodingFactory encodingFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal DbCryptCallback
Creates an instance ofDbCryptCallback
for this connection.final T
final Encoding
final EncodingDefinition
final IEncodingFactory
abstract C
identify()
Performs the connection identification phase of the protocol and returns the connection handle implementation for the agreed protocol.protected final boolean
protected final LockCloseable
withLock()
-
Field Details
-
attachProperties
-
-
Constructor Details
-
AbstractConnection
protected AbstractConnection(T attachProperties, IEncodingFactory encodingFactory) throws SQLException - Throws:
SQLException
-
-
Method Details
-
withLock
- See Also:
-
isLockedByCurrentThread
protected final boolean isLockedByCurrentThread()- See Also:
-
identify
Performs the connection identification phase of the protocol and returns the connection handle implementation for the agreed protocol.- Returns:
- Connection handle (ie
FbDatabase
orFbService
) - Throws:
SQLException
- For exceptions connecting
-
getAttachProperties
- Returns:
- An immutable copy of the current attach properties.
-
getEncodingDefinition
-
getEncoding
-
getEncodingFactory
-
createDbCryptCallback
Creates an instance ofDbCryptCallback
for this connection.- Returns:
- Database encryption callback.
- Throws:
SQLException
- For errors initializing the callback
-