public abstract class AbstractFbAttachment<T extends AbstractConnection<? extends IAttachProperties,? extends FbAttachment>> extends java.lang.Object implements FbAttachment
AbstractFbService
and AbstractFbDatabase
.Modifier and Type | Field and Description |
---|---|
protected T |
connection |
protected ExceptionListenerDispatcher |
exceptionListenerDispatcher |
Modifier | Constructor and Description |
---|---|
protected |
AbstractFbAttachment(T connection,
DatatypeCoder datatypeCoder) |
Modifier and Type | Method and Description |
---|---|
void |
addExceptionListener(ExceptionListener listener)
Adds an exception listener to this object.
|
protected abstract void |
checkConnected()
Checks if the attachment is connected, and throws a
SQLException if it isn't connected. |
protected DbCryptCallback |
createDbCryptCallback()
Creates an instance of
DbCryptCallback for this attachment. |
DatatypeCoder |
getDatatypeCoder() |
Encoding |
getEncoding() |
IEncodingFactory |
getEncodingFactory() |
GDSServerVersion |
getServerVersion() |
protected org.firebirdsql.gds.ng.ServerVersionInformation |
getServerVersionInformation() |
java.lang.Object |
getSynchronizationObject()
Get synchronization object.
|
boolean |
isAttached()
Current attachment status.
|
void |
removeExceptionListener(ExceptionListener listener)
Removes an exception listener to this object.
|
protected void |
safelyDetach()
Performs
FbAttachment.close() suppressing any exception. |
protected void |
setAttached()
Called when this attachment is attached.
|
protected void |
setDetached()
Called when this attachment is detached.
|
protected void |
setServerVersion(java.lang.String... versionStrings)
Sets the Firebird version from one or more version string elements.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attach, close, getHandle
protected final ExceptionListenerDispatcher exceptionListenerDispatcher
protected final T extends AbstractConnection<? extends IAttachProperties,? extends FbAttachment> connection
protected AbstractFbAttachment(T connection, DatatypeCoder datatypeCoder)
public GDSServerVersion getServerVersion()
getServerVersion
in interface FbAttachment
protected final void setServerVersion(java.lang.String... versionStrings)
This method should only be called by this instance.
versionStrings
- Raw version stringsprotected org.firebirdsql.gds.ng.ServerVersionInformation getServerVersionInformation()
protected final void setAttached()
Only this AbstractFbDatabase
instance should call this method.
public boolean isAttached()
FbAttachment
isAttached
in interface FbAttachment
true
if connected to the server and attached to a database or service, false
otherwise.protected final void setDetached()
Only this AbstractFbAttachment
instance should call this method.
public final java.lang.Object getSynchronizationObject()
FbAttachment
getSynchronizationObject
in interface FbAttachment
null
.public final IEncodingFactory getEncodingFactory()
getEncodingFactory
in interface FbAttachment
IEncodingFactory
for this connectionpublic final Encoding getEncoding()
getEncoding
in interface FbAttachment
IEncodingFactory.getDefaultEncoding()
on the result of FbAttachment.getEncodingFactory()
.public final DatatypeCoder getDatatypeCoder()
getDatatypeCoder
in interface FbAttachment
DatatypeCoder
for this database implementation.public final void addExceptionListener(ExceptionListener listener)
ExceptionListenable
Implementations use WeakReference
.
addExceptionListener
in interface ExceptionListenable
listener
- Listener to registerpublic final void removeExceptionListener(ExceptionListener listener)
ExceptionListenable
removeExceptionListener
in interface ExceptionListenable
listener
- Listener to removeprotected abstract void checkConnected() throws java.sql.SQLException
SQLException
if it isn't connected.java.sql.SQLException
protected final void safelyDetach()
FbAttachment.close()
suppressing any exception.protected final DbCryptCallback createDbCryptCallback() throws java.sql.SQLException
DbCryptCallback
for this attachment.java.sql.SQLException
- For errors initializing the callbackCopyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.