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
ConstructorsModifierConstructorDescriptionprotectedAbstractConnection(T attachProperties, IEncodingFactory encodingFactory) -
Method Summary
Modifier and TypeMethodDescriptionfinal DbCryptCallbackCreates an instance ofDbCryptCallbackfor this connection.final Tfinal Encodingfinal EncodingDefinitionfinal IEncodingFactoryabstract Cidentify()Performs the connection identification phase of the protocol and returns the connection handle implementation for the agreed protocol.protected final booleanprotected final LockCloseablewithLock()
-
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
FbDatabaseorFbService) - Throws:
SQLException- For exceptions connecting
-
getAttachProperties
- Returns:
- An immutable copy of the current attach properties.
-
getEncodingDefinition
-
getEncoding
-
getEncodingFactory
-
createDbCryptCallback
Creates an instance ofDbCryptCallbackfor this connection.- Returns:
- Database encryption callback.
- Throws:
SQLException- For errors initializing the callback
-