Package jmri.jmrix.bidib
Class BiDiBNodeInitializer
java.lang.Object
jmri.jmrix.bidib.BiDiBNodeInitializer
- All Implemented Interfaces:
Runnable
This class initializes or deinitializes a BiDiB node when it is found on system startup or if it
is discovered or lost while the system is running.\
The real work is done in its own thread and from a node queue. Initializing is a time consuming
process since a lot of data is read from the node.
-
Constructor Summary
ConstructorsConstructorDescriptionBiDiBNodeInitializer(BiDiBTrafficController tc, org.bidib.jbidibc.core.BidibInterface bidib, Map<Long, org.bidib.jbidibc.messages.Node> nodes) -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet data from root node and from all other nodesvoidRemove all nodesvoidinitNode(org.bidib.jbidibc.messages.Node node) Get everything we need from the node.voidnodeLost(org.bidib.jbidibc.messages.Node node) Remove a node from all named beans and from the nodes listvoidnodeNew(org.bidib.jbidibc.messages.Node node) Add a node to nodes list and notify all named beans to updatevoidrun()Execute queued node init and named beans update.
-
Constructor Details
-
BiDiBNodeInitializer
public BiDiBNodeInitializer(BiDiBTrafficController tc, org.bidib.jbidibc.core.BidibInterface bidib, Map<Long, org.bidib.jbidibc.messages.Node> nodes)
-
-
Method Details
-
initNode
public void initNode(org.bidib.jbidibc.messages.Node node) throws org.bidib.jbidibc.messages.exception.ProtocolException Get everything we need from the node. The node must already be inserted into the BiDiB node list.- Parameters:
node- node to initialize- Throws:
org.bidib.jbidibc.messages.exception.ProtocolException- when features can't be loaded
-
nodeLost
Remove a node from all named beans and from the nodes list- Parameters:
node- to remove
-
nodeNew
Add a node to nodes list and notify all named beans to update- Parameters:
node- to add
-
connectionLost
Remove all nodes -
connectionInit
Get data from root node and from all other nodes- Returns:
- true on success
-
run
Execute queued node init and named beans update. Finish the thread if the queue is empty
-