public class V10AsynchronousChannel extends java.lang.Object implements FbWireAsynchronousChannel
Constructor and Description |
---|
V10AsynchronousChannel(FbWireDatabase database) |
Modifier and Type | Method and Description |
---|---|
void |
addChannelListener(AsynchronousChannelListener listener)
Register a listener for this channel.
|
void |
cancelEvent(EventHandle eventHandle)
Cancels a registered event.
|
void |
close()
Disconnect the asynchronous channel.
|
void |
connect(java.lang.String hostName,
int portNumber,
int auxHandle)
Connects the asynchronous channel to the specified port.
|
protected void |
finalize() |
java.nio.ByteBuffer |
getEventBuffer() |
java.nio.channels.SocketChannel |
getSocketChannel() |
boolean |
isConnected() |
void |
processEventData()
Process the current event data in the buffer.
|
void |
queueEvent(EventHandle eventHandle)
Queues a wait for an event.
|
void |
removeChannelListener(AsynchronousChannelListener listener)
Remove a listener from this channel
|
public V10AsynchronousChannel(FbWireDatabase database)
public void connect(java.lang.String hostName, int portNumber, int auxHandle) throws java.sql.SQLException
FbWireAsynchronousChannel
connect
in interface FbWireAsynchronousChannel
hostName
- HostnameportNumber
- The port numberauxHandle
- Handle identifier for this asynchronous channeljava.sql.SQLException
- For errors connecting, or if the connection is already establishedpublic void close() throws java.sql.SQLException
FbWireAsynchronousChannel
Once closed, the connection can be reestablished using FbWireAsynchronousChannel.connect(String, int, int)
.
Calling close
on a closed channel is a no-op; no exception should be thrown.
close
in interface FbWireAsynchronousChannel
java.sql.SQLException
- For errors closing the channelpublic boolean isConnected()
isConnected
in interface FbWireAsynchronousChannel
true
if connected, otherwise false
public void addChannelListener(AsynchronousChannelListener listener)
FbWireAsynchronousChannel
addChannelListener
in interface FbWireAsynchronousChannel
listener
- Listenerpublic void removeChannelListener(AsynchronousChannelListener listener)
FbWireAsynchronousChannel
removeChannelListener
in interface FbWireAsynchronousChannel
listener
- Listenerpublic java.nio.channels.SocketChannel getSocketChannel() throws java.sql.SQLException
getSocketChannel
in interface FbWireAsynchronousChannel
java.sql.SQLException
- If not currently connectedpublic java.nio.ByteBuffer getEventBuffer()
getEventBuffer
in interface FbWireAsynchronousChannel
public void processEventData()
FbWireAsynchronousChannel
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).
processEventData
in interface FbWireAsynchronousChannel
public void queueEvent(EventHandle eventHandle) throws java.sql.SQLException
FbWireAsynchronousChannel
queueEvent
in interface FbWireAsynchronousChannel
eventHandle
- Event handlejava.sql.SQLException
public void cancelEvent(EventHandle eventHandle) throws java.sql.SQLException
FbWireAsynchronousChannel
cancelEvent
in interface FbWireAsynchronousChannel
eventHandle
- The event handle to canceljava.sql.SQLException
- For errors cancelling the eventprotected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.