private class OlcbInterface.QueuedOutputConnection extends Object implements Connection
The caller must donate a thread to this connection by calling the run() method.
Modifier and Type | Class and Description |
---|---|
private class |
OlcbInterface.QueuedOutputConnection.QEntry |
Connection.ConnectionListener
Modifier and Type | Field and Description |
---|---|
private BlockingQueue<OlcbInterface.QueuedOutputConnection.QEntry> |
outputQueue |
private int |
pendingCount |
private Connection |
realOutput |
Constructor and Description |
---|
QueuedOutputConnection(Connection realOutput) |
Modifier and Type | Method and Description |
---|---|
void |
put(Message msg,
Connection sender)
Put a message to this connection.
|
void |
registerStartNotification(Connection.ConnectionListener c)
Register to be informed when this connection is ready
to accept messages.
|
private void |
run()
Never returns.
|
void |
waitForSendQueue() |
private final Connection realOutput
private final BlockingQueue<OlcbInterface.QueuedOutputConnection.QEntry> outputQueue
private int pendingCount
QueuedOutputConnection(Connection realOutput)
public void put(Message msg, Connection sender)
Connection
put
in interface Connection
msg
- message to sendsender
- Node that is sending the message, used
for tracking, logging, etc.
(This models a two-ended connection to whatever
communications link is used)public void registerStartNotification(Connection.ConnectionListener c)
Connection
registerStartNotification
in interface Connection
c
- callback object to invokepublic void waitForSendQueue()
private void run()
Copyright © 2017 The OpenLCB Group. All rights reserved.