|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.uiuc.cs.seclab.modem.xbee.XBeeTxnCoord
public class XBeeTxnCoord
Coordinates the execution of a list of AT commands. It sends messages individually and asynchronously, and then associates the responses with the appropriate command.
| Nested Class Summary | |
|---|---|
protected class |
XBeeTxnCoord.TxnBabysitter
Thread that waits for a single transaction to complete |
| Field Summary | |
|---|---|
protected int |
babysitterCnt
|
protected int |
cnt
|
protected java.util.concurrent.BlockingQueue<XBeeTxn> |
completedQ
|
protected java.lang.Thread |
coordThread
|
static int |
DEFL_BACKLOG
|
protected boolean |
halted
|
protected XBeeModem |
mdm
|
protected int |
outstandingTxns
Number of outstanding transactions tolerated by system |
protected java.util.Stack<XBeeTxnCoord.TxnBabysitter> |
sitters
|
protected java.util.concurrent.BlockingQueue<XBeeTxn> |
toExec
|
static int |
TXN_TOUT
|
protected XBeeTxn[] |
waiting
|
| Constructor Summary | |
|---|---|
XBeeTxnCoord(XBeeModem mdm_,
int outstandingTxns_)
Create a command coordinator for a specified list of commands. |
|
| Method Summary | |
|---|---|
private void |
abortTxn(XBeeTxn txn)
|
private void |
completeTxn(XBeeTxn txn)
|
void |
execCmd(XBeeAtCmd cmd,
XBeeAtCmd.Mode mode,
long toutMs)
Insert a new command transaction into the queue. |
void |
execTxn(XBeeTxn txn,
long toutMs)
Insert a new transaction into the queue. |
protected void |
finalize()
|
private XBeeTxnCoord.TxnBabysitter |
getBabysitter()
Get/create an available transaction babysitter. |
java.util.concurrent.BlockingQueue<XBeeTxn> |
getCompletedQueue()
Return a reference to the queue for completed transactions, so that the controlling process can synchronously process responses as they are received. |
void |
halt()
|
void |
handleXBeePacket(XBeeApiPacket apiPkt)
|
private void |
launchTxn(XBeeTxn txn)
|
private void |
recycleBabysitter(XBeeTxnCoord.TxnBabysitter sitter)
|
void |
run()
|
void |
sendTx(XBeeTxPacket pkt,
long toutMs)
Insert a new transmission transaction into the queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int babysitterCnt
protected int cnt
protected java.util.concurrent.BlockingQueue<XBeeTxn> completedQ
protected java.lang.Thread coordThread
public static final int DEFL_BACKLOG
protected boolean halted
protected XBeeModem mdm
protected int outstandingTxns
protected java.util.Stack<XBeeTxnCoord.TxnBabysitter> sitters
protected java.util.concurrent.BlockingQueue<XBeeTxn> toExec
public static final int TXN_TOUT
protected XBeeTxn[] waiting
| Constructor Detail |
|---|
public XBeeTxnCoord(XBeeModem mdm_,
int outstandingTxns_)
throws ModemException,
java.io.IOException
java.io.IOException - getBabysitter().setTxn(txn, TXN_TOUT);
ModemException| Method Detail |
|---|
private void abortTxn(XBeeTxn txn)
private void completeTxn(XBeeTxn txn)
public void execCmd(XBeeAtCmd cmd,
XBeeAtCmd.Mode mode,
long toutMs)
throws ModemException
ModemException
public void execTxn(XBeeTxn txn,
long toutMs)
throws ModemException
ModemException
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwableprivate XBeeTxnCoord.TxnBabysitter getBabysitter()
public java.util.concurrent.BlockingQueue<XBeeTxn> getCompletedQueue()
public void halt()
public void handleXBeePacket(XBeeApiPacket apiPkt)
handleXBeePacket in interface XBeeModemRecvListener
private void launchTxn(XBeeTxn txn)
throws ModemException,
java.io.IOException
ModemException
java.io.IOExceptionprivate void recycleBabysitter(XBeeTxnCoord.TxnBabysitter sitter)
public void run()
run in interface java.lang.Runnable
public void sendTx(XBeeTxPacket pkt,
long toutMs)
throws ModemException
ModemException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||