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:
- java.lang.AutoCloseable,- FbAttachment,- FbService,- ExceptionListenable
 - Direct Known Subclasses:
- AbstractFbWireService,- JnaService
 
 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 SummaryFields Modifier and Type Field Description protected ServiceListenerDispatcherserviceListenerDispatcher- 
Fields inherited from class org.firebirdsql.gds.ng.AbstractFbAttachmentconnection, exceptionListenerDispatcher
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractFbService(T connection, DatatypeCoder datatypeCoder)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddServiceListener(ServiceListener listener)Adds aServiceListenerinstance to this database.voidclose()Detaches and closes the connection.protected ServiceRequestBuffergetDescribeServiceRequestBuffer()<R> RgetServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int bufferLength, InfoProcessor<R> infoProcessor)Request service info (service query).protected InfoProcessor<FbService>getServiceInformationProcessor()protected WarningMessageCallbackgetServiceWarningCallback()protected abstract voidinternalDetach()Actual implementation of service detach.voidremoveServiceListener(ServiceListener listener)Removes aServiceListenerinstance from this database.- 
Methods inherited from class org.firebirdsql.gds.ng.AbstractFbAttachmentaddExceptionListener, checkConnected, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, getServerVersionInformation, isAttached, isLockedByCurrentThread, removeExceptionListener, safelyDetach, setAttached, setDetached, setServerVersion, withLock
 - 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.firebirdsql.gds.ng.listeners.ExceptionListenableaddExceptionListener, removeExceptionListener
 - 
Methods inherited from interface org.firebirdsql.gds.ng.FbAttachmentattach, forceClose, getDatatypeCoder, getEncoding, getEncodingFactory, getNetworkTimeout, getServerVersion, isAttached, isLockedByCurrentThread, setNetworkTimeout, withLock
 - 
Methods inherited from interface org.firebirdsql.gds.ng.FbServicecreateServiceParameterBuffer, createServiceRequestBuffer, getHandle, getServiceInfo, startServiceAction
 
- 
 
- 
- 
- 
Field Detail- 
serviceListenerDispatcherprotected final ServiceListenerDispatcher serviceListenerDispatcher 
 
- 
 - 
Constructor Detail- 
AbstractFbServiceprotected AbstractFbService(T connection, DatatypeCoder datatypeCoder) 
 
- 
 - 
Method Detail- 
getServiceInfopublic final <R> R getServiceInfo(ServiceParameterBuffer serviceParameterBuffer, ServiceRequestBuffer serviceRequestBuffer, int bufferLength, InfoProcessor<R> infoProcessor) throws java.sql.SQLException Description copied from interface:FbServiceRequest service info (service query).- Specified by:
- getServiceInfoin interface- FbService
- Parameters:
- serviceParameterBuffer- Service parameters
- serviceRequestBuffer- Service request info
- bufferLength- Response buffer length to use
- infoProcessor- Implementation of- InfoProcessorto transform the info response
- Returns:
- Transformed info response of type T
- Throws:
- java.sql.SQLException- For errors retrieving or transforming the response.
 
 - 
addServiceListenerpublic final void addServiceListener(ServiceListener listener) Description copied from interface:FbServiceAdds aServiceListenerinstance to this database.- Specified by:
- addServiceListenerin interface- FbService
- Parameters:
- listener- Database listener
 
 - 
removeServiceListenerpublic final void removeServiceListener(ServiceListener listener) Description copied from interface:FbServiceRemoves aServiceListenerinstance from this database.- Specified by:
- removeServiceListenerin interface- FbService
- Parameters:
- listener- Database Listener
 
 - 
internalDetachprotected abstract void internalDetach() throws java.sql.SQLExceptionActual 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:
- java.sql.SQLException
 
 - 
closepublic final void close() throws java.sql.SQLExceptionDetaches 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 interface- java.lang.AutoCloseable
- Specified by:
- closein interface- FbAttachment
- Throws:
- java.sql.SQLException- If not currently connected, or another problem occurred detaching.
 
 - 
getServiceWarningCallbackprotected final WarningMessageCallback getServiceWarningCallback() - Returns:
- The warning callback for this service.
 
 - 
getDescribeServiceRequestBufferprotected ServiceRequestBuffer getDescribeServiceRequestBuffer() 
 - 
getServiceInformationProcessorprotected InfoProcessor<FbService> getServiceInformationProcessor() 
 
- 
 
-