org.sourceforge.jxdbcon.postgresql
Class NetProtocolV2Async
java.lang.Object
|
+--org.sourceforge.jxdbcon.postgresql.NetProtocol
|
+--org.sourceforge.jxdbcon.postgresql.NetProtocolV1
|
+--org.sourceforge.jxdbcon.postgresql.NetProtocolV2
|
+--org.sourceforge.jxdbcon.postgresql.NetProtocolV2Async
- All Implemented Interfaces:
- InfoKeys, PGConstants, PGInfoKeys, PGProtocol, Runnable
- public class NetProtocolV2Async
- extends NetProtocolV2
- implements Runnable
Asynchronous frontend/backend protocol.
This protocol is selected by the UseAsync key when connecting.
It can be used for real-time LISTEN/NOTIFY handling.
Nested classes inherited from class org.sourceforge.jxdbcon.postgresql.NetProtocolV1 |
NetProtocolV1.AsciiRow, NetProtocolV1.Authentication, NetProtocolV1.BinaryRow, NetProtocolV1.CompletedResponse, NetProtocolV1.CursorResponse, NetProtocolV1.EmptyQueryResponse, NetProtocolV1.EmptyResponse, NetProtocolV1.ErrorResponse, NetProtocolV1.FunctionResult, NetProtocolV1.MessageResponse, NetProtocolV1.NoticeResponse, NetProtocolV1.NotificationResponse, NetProtocolV1.Response, NetProtocolV1.RowDescription |
Fields inherited from class org.sourceforge.jxdbcon.postgresql.NetProtocolV2 |
|
Fields inherited from interface org.sourceforge.jxdbcon.postgresql.PGConstants |
AUTH_REQ_CRYPT, AUTH_REQ_KRB4, AUTH_REQ_KRB5, AUTH_REQ_MD5, AUTH_REQ_OK, AUTH_REQ_PASSWORD, AUTH_REQ_SCM, NUMERIC_DSCALE_MASK, NUMERIC_NAN, NUMERIC_NEG, NUMERIC_POS, NUMERIC_SIGN_MASK, PG_VERSION_STR, PG_VERSION_STR1, TRIGGER_TYPE_BEFORE, TRIGGER_TYPE_DELETE, TRIGGER_TYPE_INSERT, TRIGGER_TYPE_ROW, TRIGGER_TYPE_UPDATE |
goon
private boolean goon
- Flag for read loop.
lst
private LinkedList lst
- List of incoming messages.
lstLock
private Object lstLock
- Lock for the linked list.
thread
private Thread thread
- The read loop's thread.
NetProtocolV2Async
public NetProtocolV2Async()
connectSocket
protected void connectSocket(Properties info)
throws IOException
- Connect to the backend and start the read loop.
Once the connection is established the read-loops thread is started.
- Overrides:
connectSocket
in class NetProtocol
IOException
readFirst
protected NetProtocolV1.Response readFirst()
throws InterruptedException
- Return the first message from the backend.
This method blocks until the message list has an item to retrieve.
- Overrides:
readFirst
in class NetProtocolV1
- Throws:
InterruptedException
- if the operation was interrupted
run
public void run()
- Do the read loop.
- Specified by:
run
in interface Runnable
sendClose
protected void sendClose()
throws IOException
- Send the close command.
This method additionally signals the read-loop to end its operation.
- Overrides:
sendClose
in class NetProtocolV1
IOException
toString
public String toString()
- Overrides:
toString
in class Object
Copyright © 2001,2002 Keve Müller; see LICENSE file for details.