Class V10AsynchronousChannel
- java.lang.Object
- 
- org.firebirdsql.gds.ng.wire.version10.V10AsynchronousChannel
 
- 
- All Implemented Interfaces:
- FbWireAsynchronousChannel
 
 public class V10AsynchronousChannel extends java.lang.Object implements FbWireAsynchronousChannel Asynchronous channel implementation for the V10 wire protocol.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Constructor SummaryConstructors Constructor Description V10AsynchronousChannel(FbWireDatabase database)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddChannelListener(AsynchronousChannelListener listener)Register a listener for this channel.voidcancelEvent(EventHandle eventHandle)Cancels a registered event.voidclose()Disconnect the asynchronous channel.voidconnect(java.lang.String hostName, int portNumber, int auxHandle)Connects the asynchronous channel to the specified port.protected voidfinalize()java.nio.ByteBuffergetEventBuffer()java.nio.channels.SocketChannelgetSocketChannel()booleanisConnected()voidprocessEventData()Process the current event data in the buffer.voidqueueEvent(EventHandle eventHandle)Queues a wait for an event.voidremoveChannelListener(AsynchronousChannelListener listener)Remove a listener from this channelprotected LockCloseablewithLock()
 
- 
- 
- 
Constructor Detail- 
V10AsynchronousChannelpublic V10AsynchronousChannel(FbWireDatabase database) 
 
- 
 - 
Method Detail- 
withLockprotected final LockCloseable withLock() - See Also:
- FbAttachment.withLock()
 
 - 
connectpublic void connect(java.lang.String hostName, int portNumber, int auxHandle) throws java.sql.SQLExceptionDescription copied from interface:FbWireAsynchronousChannelConnects the asynchronous channel to the specified port.- Specified by:
- connectin interface- FbWireAsynchronousChannel
- Parameters:
- hostName- Hostname
- portNumber- The port number
- auxHandle- Handle identifier for this asynchronous channel
- Throws:
- java.sql.SQLException- For errors connecting, or if the connection is already established
 
 - 
closepublic void close() throws java.sql.SQLExceptionDescription copied from interface:FbWireAsynchronousChannelDisconnect the asynchronous channel.Once closed, the connection can be reestablished using FbWireAsynchronousChannel.connect(String, int, int).Calling closeon a closed channel is a no-op; no exception should be thrown.- Specified by:
- closein interface- FbWireAsynchronousChannel
- Throws:
- java.sql.SQLException- For errors closing the channel
 
 - 
isConnectedpublic boolean isConnected() - Specified by:
- isConnectedin interface- FbWireAsynchronousChannel
- Returns:
- trueif connected, otherwise- false
 
 - 
addChannelListenerpublic void addChannelListener(AsynchronousChannelListener listener) Description copied from interface:FbWireAsynchronousChannelRegister a listener for this channel.- Specified by:
- addChannelListenerin interface- FbWireAsynchronousChannel
- Parameters:
- listener- Listener
 
 - 
removeChannelListenerpublic void removeChannelListener(AsynchronousChannelListener listener) Description copied from interface:FbWireAsynchronousChannelRemove a listener from this channel- Specified by:
- removeChannelListenerin interface- FbWireAsynchronousChannel
- Parameters:
- listener- Listener
 
 - 
getSocketChannelpublic java.nio.channels.SocketChannel getSocketChannel() throws java.sql.SQLException- Specified by:
- getSocketChannelin interface- FbWireAsynchronousChannel
- Returns:
- The socket channel associated with this asynchronous channel
- Throws:
- java.sql.SQLException- If not currently connected
 
 - 
getEventBufferpublic java.nio.ByteBuffer getEventBuffer() - Specified by:
- getEventBufferin interface- FbWireAsynchronousChannel
- Returns:
- The byte buffer for event data
 
 - 
processEventDatapublic void processEventData() Description copied from interface:FbWireAsynchronousChannelProcess the current event data in the buffer.This is only to be called by the AsynchronousProcessor. Implementations should be ready to deal with incomplete data in the event buffer (eg by not processing).- Specified by:
- processEventDatain interface- FbWireAsynchronousChannel
 
 - 
queueEventpublic void queueEvent(EventHandle eventHandle) throws java.sql.SQLException Description copied from interface:FbWireAsynchronousChannelQueues a wait for an event.- Specified by:
- queueEventin interface- FbWireAsynchronousChannel
- Parameters:
- eventHandle- Event handle
- Throws:
- java.sql.SQLException
 
 - 
cancelEventpublic void cancelEvent(EventHandle eventHandle) throws java.sql.SQLException Description copied from interface:FbWireAsynchronousChannelCancels a registered event.- Specified by:
- cancelEventin interface- FbWireAsynchronousChannel
- Parameters:
- eventHandle- The event handle to cancel
- Throws:
- java.sql.SQLException- For errors cancelling the event
 
 - 
finalizeprotected void finalize() throws java.lang.Throwable- Overrides:
- finalizein class- java.lang.Object
- Throws:
- java.lang.Throwable
 
 
- 
 
-