Class BiDiBNodeInitializer

  • All Implemented Interfaces:
    java.lang.Runnable

    public class BiDiBNodeInitializer
    extends java.lang.Object
    implements java.lang.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

      Constructors 
      Constructor Description
      BiDiBNodeInitializer​(BiDiBTrafficController tc, org.bidib.jbidibc.core.BidibInterface bidib, java.util.Map<java.lang.Long,​org.bidib.jbidibc.messages.Node> nodes)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void initNode​(org.bidib.jbidibc.messages.Node node)
      Get everything we need from the node.
      void nodeLost​(org.bidib.jbidibc.messages.Node node)
      Remove a node from all named beans and from the nodes list
      void nodeNew​(org.bidib.jbidibc.messages.Node node)
      Add a node to nodes list and notify all named beans to update
      void run()
      Execute queued node init and named beans update.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • 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

        public void nodeLost​(org.bidib.jbidibc.messages.Node node)
        Remove a node from all named beans and from the nodes list
        Parameters:
        node - to remove
      • nodeNew

        public void nodeNew​(org.bidib.jbidibc.messages.Node node)
        Add a node to nodes list and notify all named beans to update
        Parameters:
        node - to add
      • run

        public void run()
        Execute queued node init and named beans update. Finish the thread if the queue is empty
        Specified by:
        run in interface java.lang.Runnable