Package org.firebirdsql.gds.ng.wire
Interface FbWireAsynchronousChannel
- 
- All Known Implementing Classes:
- V10AsynchronousChannel
 
 public interface FbWireAsynchronousChannelInterface for the asynchronous channel used for event notification.- Since:
- 3.0
- Author:
- Mark Rotteveel
 
- 
- 
Method SummaryAll Methods Instance Methods Abstract 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.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 channel
 
- 
- 
- 
Method Detail- 
connectvoid connect(java.lang.String hostName, int portNumber, int auxHandle) throws java.sql.SQLExceptionConnects the asynchronous channel to the specified port.- 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
 
 - 
closevoid close() throws java.sql.SQLExceptionDisconnect the asynchronous channel.Once closed, the connection can be reestablished using connect(String, int, int).Calling closeon a closed channel is a no-op; no exception should be thrown.- Throws:
- java.sql.SQLException- For errors closing the channel
 
 - 
isConnectedboolean isConnected() - Returns:
- trueif connected, otherwise- false
 
 - 
addChannelListenervoid addChannelListener(AsynchronousChannelListener listener) Register a listener for this channel.- Parameters:
- listener- Listener
 
 - 
removeChannelListenervoid removeChannelListener(AsynchronousChannelListener listener) Remove a listener from this channel- Parameters:
- listener- Listener
 
 - 
getSocketChanneljava.nio.channels.SocketChannel getSocketChannel() throws java.sql.SQLException- Returns:
- The socket channel associated with this asynchronous channel
- Throws:
- java.sql.SQLException- If not currently connected
 
 - 
getEventBufferjava.nio.ByteBuffer getEventBuffer() - Returns:
- The byte buffer for event data
 
 - 
processEventDatavoid processEventData() Process 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).
 - 
queueEventvoid queueEvent(EventHandle eventHandle) throws java.sql.SQLException Queues a wait for an event.- Parameters:
- eventHandle- Event handle
- Throws:
- java.sql.SQLException
 
 - 
cancelEventvoid cancelEvent(EventHandle eventHandle) throws java.sql.SQLException Cancels a registered event.- Parameters:
- eventHandle- The event handle to cancel
- Throws:
- java.sql.SQLException- For errors cancelling the event
 
 
- 
 
-