|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.xpa.XpaTrafficController
public final class XpaTrafficController
Converts Stream-based I/O to/from Xpa messages. The "XpaInterface" side sends/receives message objects. The connection to an XpaPortController is via a pair of *Streams, which then carry sequences of characters for transmission. Note that this processing is handled in an independent thread.
| Field Summary | |
|---|---|
protected Vector<XpaListener> |
cmdListeners
|
protected static XpaTrafficController |
self
|
| Constructor Summary | |
|---|---|
XpaTrafficController()
|
|
| Method Summary | |
|---|---|
void |
addXpaListener(XpaListener l)
|
void |
connectPort(XpaPortController p)
Make connection to existing PortController object. |
void |
disconnectPort(XpaPortController p)
Break connection to existing XpaPortController object. |
static XpaTrafficController |
instance()
static function returning the XpaTrafficController instance to use. |
protected void |
notifyMessage(XpaMessage m,
XpaListener notMe)
Forward a XpaMessage to all registered XpaInterface listeners. |
protected void |
notifyReply(XpaMessage r)
|
void |
removeXpaListener(XpaListener l)
|
void |
run()
Handle incoming characters. |
void |
sendXpaMessage(XpaMessage m,
XpaListener reply)
Forward a preformatted message to the actual interface. |
boolean |
status()
Test operational status of interface. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Vector<XpaListener> cmdListeners
protected static volatile XpaTrafficController self
| Constructor Detail |
|---|
public XpaTrafficController()
| Method Detail |
|---|
public boolean status()
XpaInterface
status in interface XpaInterfacepublic void addXpaListener(XpaListener l)
addXpaListener in interface XpaInterfacepublic void removeXpaListener(XpaListener l)
removeXpaListener in interface XpaInterface
protected void notifyMessage(XpaMessage m,
XpaListener notMe)
protected void notifyReply(XpaMessage r)
public void sendXpaMessage(XpaMessage m,
XpaListener reply)
sendXpaMessage in interface XpaInterfacem - Message to be sent.reply - Listener to be notified of reply.public void connectPort(XpaPortController p)
public void disconnectPort(XpaPortController p)
public static XpaTrafficController instance()
public void run()
connectPort.
Terminates with the input stream breaking out of the try block.
run in interface Runnable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||