Module org.firebirdsql.jaybird
Package org.firebirdsql.gds.ng
Class AbstractFbService<T extends AbstractConnection<IServiceProperties,? extends FbService>>
java.lang.Object
org.firebirdsql.gds.ng.AbstractFbAttachment<T>
org.firebirdsql.gds.ng.AbstractFbService<T>
- All Implemented Interfaces:
AutoCloseable,FbAttachment,FbService,ExceptionListenable
- Direct Known Subclasses:
AbstractFbWireService
public abstract class AbstractFbService<T extends AbstractConnection<IServiceProperties,? extends FbService>>
extends AbstractFbAttachment<T>
implements FbService
Abstract service implementation.
- Since:
- 3.0
- Author:
- Mark Rotteveel
-
Field Summary
FieldsFields inherited from class org.firebirdsql.gds.ng.AbstractFbAttachment
connection, exceptionListenerDispatcher -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractFbService(T connection, DatatypeCoder datatypeCoder) -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddServiceListener(ServiceListener listener) Adds aServiceListenerinstance to this database.final voidclose()Detaches and closes the connection.protected ServiceRequestBufferfinal <R> RgetServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int bufferLength, InfoProcessor<R> infoProcessor) Request service info (service query).protected InfoProcessor<FbService>protected final WarningMessageCallbackprotected abstract voidActual implementation of service detach.final voidremoveServiceListener(ServiceListener listener) Removes aServiceListenerinstance from this database.Methods inherited from class org.firebirdsql.gds.ng.AbstractFbAttachment
addExceptionListener, checkConnected, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, isAttached, isLockedByCurrentThread, removeExceptionListener, requireNotAttached, safelyDetach, setAttached, setDetached, setServerVersion, withLockMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenable
addExceptionListener, removeExceptionListenerMethods inherited from interface org.firebirdsql.gds.ng.FbAttachment
attach, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, isAttached, isLockedByCurrentThread, setNetworkTimeout, withLockMethods inherited from interface org.firebirdsql.gds.ng.FbService
createServiceParameterBuffer, createServiceRequestBuffer, getHandle, getServiceInfo, startServiceAction
-
Field Details
-
serviceListenerDispatcher
-
-
Constructor Details
-
AbstractFbService
-
-
Method Details
-
getServiceInfo
public final <R> R getServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int bufferLength, InfoProcessor<R> infoProcessor) throws SQLException Description copied from interface:FbServiceRequest service info (service query).- Specified by:
getServiceInfoin interfaceFbService- Parameters:
serviceParameterBuffer- Service parametersserviceRequestBuffer- Service request infobufferLength- Response buffer length to useinfoProcessor- Implementation ofInfoProcessorto transform the info response- Returns:
- Transformed info response of type T
- Throws:
SQLException- For errors retrieving or transforming the response.
-
addServiceListener
Description copied from interface:FbServiceAdds aServiceListenerinstance to this database.- Specified by:
addServiceListenerin interfaceFbService- Parameters:
listener- Database listener
-
removeServiceListener
Description copied from interface:FbServiceRemoves aServiceListenerinstance from this database.- Specified by:
removeServiceListenerin interfaceFbService- Parameters:
listener- Database Listener
-
internalDetach
Actual implementation of service detach.Implementations of this method should only be called from
close(), and should not notify service listeners of the serviceServiceListener.detaching(FbService)andServiceListener.detached(FbService)events.- Throws:
SQLException
-
close
Detaches and closes the connection.Implementation note: Calls
AbstractFbAttachment.checkConnected()and notifies service listeners of the detaching event, then callsinternalDetach()and finally notifies service listeners of database detach and removes all listeners.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceFbAttachment- Throws:
SQLException- If not currently connected, or another problem occurred detaching.
-
getServiceWarningCallback
- Returns:
- The warning callback for this service.
-
getDescribeServiceRequestBuffer
-
getServiceInformationProcessor
-