|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractMRTrafficController
jmri.jmrix.jmriclient.JMRIClientTrafficController
public class JMRIClientTrafficController
Converts Stream-based I/O to/from JMRIClient messages. The "JMRIClientInterface" side sends/receives message objects.
The connection to a JMRIClientPortController is via a pair of *Streams, which then carry sequences of characters for transmission. Note that this processing is handled in an independent thread.
This handles the state transistions, based on the necessary state in each message.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController |
|---|
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier |
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
JMRIClientTrafficController()
|
|
| Method Summary | |
|---|---|
void |
addJMRIClientListener(JMRIClientListener l)
|
protected boolean |
endOfMessage(AbstractMRReply msg)
|
protected AbstractMRMessage |
enterNormalMode()
|
protected AbstractMRMessage |
enterProgMode()
|
protected void |
forwardMessage(AbstractMRListener client,
AbstractMRMessage m)
Forward a JMRIClientMessage to all registered JMRIClientInterface listeners. |
protected void |
forwardReply(AbstractMRListener client,
AbstractMRReply m)
Forward a JMRIClientReply to all registered JMRIClientInterface listeners. |
JMRIClientTrafficController |
instance()
|
protected AbstractMRReply |
newReply()
|
protected AbstractMRMessage |
pollMessage()
Invoked if it's appropriate to do low-priority polling of the command station, this should return the next message to send, or null if the TC should just sleep. |
protected AbstractMRListener |
pollReplyHandler()
|
void |
removeJMRIClientListener(JMRIClientListener l)
|
void |
sendJMRIClientMessage(JMRIClientMessage m,
JMRIClientListener reply)
Forward a preformatted message to the actual interface. |
protected void |
setInstance()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface jmri.jmrix.jmriclient.JMRIClientInterface |
|---|
status |
| Constructor Detail |
|---|
public JMRIClientTrafficController()
| Method Detail |
|---|
public void addJMRIClientListener(JMRIClientListener l)
addJMRIClientListener in interface JMRIClientInterfacepublic void removeJMRIClientListener(JMRIClientListener l)
removeJMRIClientListener in interface JMRIClientInterface
protected void forwardMessage(AbstractMRListener client,
AbstractMRMessage m)
forwardMessage in class AbstractMRTrafficController
protected void forwardReply(AbstractMRListener client,
AbstractMRReply m)
forwardReply in class AbstractMRTrafficControllerprotected AbstractMRMessage pollMessage()
AbstractMRTrafficController
pollMessage in class AbstractMRTrafficControllerprotected AbstractMRListener pollReplyHandler()
pollReplyHandler in class AbstractMRTrafficController
public void sendJMRIClientMessage(JMRIClientMessage m,
JMRIClientListener reply)
sendJMRIClientMessage in interface JMRIClientInterfaceprotected AbstractMRMessage enterProgMode()
enterProgMode in class AbstractMRTrafficControllerprotected AbstractMRMessage enterNormalMode()
enterNormalMode in class AbstractMRTrafficControllerprotected AbstractMRReply newReply()
newReply in class AbstractMRTrafficControllerprotected boolean endOfMessage(AbstractMRReply msg)
endOfMessage in class AbstractMRTrafficControllerprotected void setInstance()
setInstance in class AbstractMRTrafficControllerpublic JMRIClientTrafficController instance()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||