|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjmri.jmrix.AbstractMRTrafficController
jmri.jmrix.lenz.XNetTrafficController
public abstract class XNetTrafficController
Abstract base class for implementations of XNetInterface.
This provides just the basic interface, plus the "" static method for locating the local implementation.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class jmri.jmrix.AbstractMRTrafficController |
|---|
AbstractMRTrafficController.RcvNotifier, AbstractMRTrafficController.XmtNotifier |
| Field Summary | |
|---|---|
protected Hashtable<XNetListener,Integer> |
mListenerMasks
|
| Fields inherited from interface jmri.jmrix.lenz.XNetInterface |
|---|
ALL, COMMINFO, CONSIST, CS_INFO, FEEDBACK, INTERFACE, PROGRAMMING, THROTTLE |
| Method Summary | |
|---|---|
void |
addXNetListener(int mask,
XNetListener l)
Request notification of things happening on the XNet. |
protected boolean |
endOfMessage(AbstractMRReply msg)
|
protected AbstractMRMessage |
enterNormalMode()
enterNormalMode() returns the value of getExitProgModeMsg(); |
protected AbstractMRMessage |
enterProgMode()
enterProgMode(); has to be available, even though it doesn't do anything on lenz |
void |
forwardMessage(AbstractMRListener reply,
AbstractMRMessage m)
Forward a preformatted XNetMessage to a specific listener interface. |
void |
forwardReply(AbstractMRListener client,
AbstractMRReply m)
Forward a preformatted XNetMessage to the registered XNetListeners. |
LenzCommandStation |
getCommandStation()
Get access to communicating command station object |
XNetSystemConnectionMemo |
getSystemConnectionMemo()
Get access to the system connection memo associated with this traffic controller |
protected void |
handleTimeout(AbstractMRMessage msg,
AbstractMRListener l)
|
static XNetTrafficController |
instance()
Deprecated. |
protected void |
loadChars(AbstractMRReply msg,
DataInputStream istream)
Get characters from the input source, and file a message. |
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()
|
protected boolean |
programmerIdle()
enterNormalMode() returns the value of getExitProgModeMsg(); |
void |
removeXNetListener(int mask,
XNetListener l)
|
void |
sendHighPriorityXNetMessage(XNetMessage m,
XNetListener reply)
|
abstract void |
sendXNetMessage(XNetMessage m,
XNetListener reply)
Forward a preformatted XNetMessage to the actual interface. |
protected void |
setInstance()
Deprecated. |
void |
setSystemConnectionMemo(XNetSystemConnectionMemo m)
Set the system connection memo associated with this traffic controller |
abstract boolean |
status()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Hashtable<XNetListener,Integer> mListenerMasks
| Method Detail |
|---|
@Deprecated public static XNetTrafficController instance()
@Deprecated protected void setInstance()
setInstance in class AbstractMRTrafficControllerpublic abstract boolean status()
status in interface XNetInterfacestatus in class AbstractMRTrafficController
public abstract void sendXNetMessage(XNetMessage m,
XNetListener reply)
sendXNetMessage in interface XNetInterfacem - Message to send; will be updated with CRC
public void forwardMessage(AbstractMRListener reply,
AbstractMRMessage m)
forwardMessage in class AbstractMRTrafficControllerm - Message to send;
public void forwardReply(AbstractMRListener client,
AbstractMRReply m)
forwardReply in class AbstractMRTrafficControllerm - Message to send
# @param client is the client getting the message
public void sendHighPriorityXNetMessage(XNetMessage m,
XNetListener reply)
protected AbstractMRMessage pollMessage()
AbstractMRTrafficController
pollMessage in class AbstractMRTrafficControllerprotected AbstractMRListener pollReplyHandler()
pollReplyHandler in class AbstractMRTrafficController
public void addXNetListener(int mask,
XNetListener l)
XNetInterfaceThe same listener can register multiple times with different masks. (Multiple registrations with a single mask value are equivalent to a single registration) Mask values are defined as class constants. Note that these are bit masks, and should be OR'd, not added, if multiple values are desired.
The event notification contains the received message as source, not this object, so that we can notify of an incoming message to multiple places and then move on.
addXNetListener in interface XNetInterfacemask - The OR of the key values of messages to be reported (to reduce traffic,
provide for listeners interested in different things)l - Object to be notified of new messages as they arrive.
public void removeXNetListener(int mask,
XNetListener l)
removeXNetListener in interface XNetInterfaceprotected AbstractMRMessage enterProgMode()
enterProgMode in class AbstractMRTrafficControllerprotected AbstractMRMessage enterNormalMode()
enterNormalMode in class AbstractMRTrafficControllerprotected boolean programmerIdle()
programmerIdle in class AbstractMRTrafficControllerprotected boolean endOfMessage(AbstractMRReply msg)
endOfMessage in class AbstractMRTrafficControllerprotected AbstractMRReply newReply()
newReply in class AbstractMRTrafficController
protected void loadChars(AbstractMRReply msg,
DataInputStream istream)
throws IOException
Returns only when the message is complete.
Only used in the Receive thread.
loadChars in class AbstractMRTrafficControllermsg - message to fillistream - character source.
IOException - when presented by the input source.
protected void handleTimeout(AbstractMRMessage msg,
AbstractMRListener l)
handleTimeout in class AbstractMRTrafficControllerpublic LenzCommandStation getCommandStation()
public XNetSystemConnectionMemo getSystemConnectionMemo()
public void setSystemConnectionMemo(XNetSystemConnectionMemo m)
m - associated systemConnectionMemo object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||