Class AbstractRoot.Controller

    • Constructor Detail

      • Controller

        protected Controller()
    • Method Detail

      • submitPacket

        public boolean submitPacket​(Packet packet)
        Description copied from interface: Root.Controller
        Deliver a Packet to this Root. This method is intended to be called from a thread other than the primary thread of the Root. It will add the packet to a queue and return immediately - this method will never block as it may be called from the thread of another Root. This method will return true if the Packet can be handled (see eg. BlockingQueue::offer)
        Specified by:
        submitPacket in interface Root.Controller
        Parameters:
        packet - message (see Packet / Call) to handle
        Returns:
        true if the packet can be handled
      • start

        public void start​(ThreadFactory threadFactory)
        Description copied from interface: Root.Controller
        Start the Root. If the Root implementation requires a primary thread to run on it will use the supplied ThreadFactory so that the RootHub can manage thread creation. The ThreadFactory is not required to support the creation of more than one Thread. Controller implementations will ensure that this method can only be invoked once.
        Specified by:
        start in interface Root.Controller
        Parameters:
        threadFactory - used if the Root requires a thread to run on.
      • shutdown

        public void shutdown()
        Description copied from interface: Root.Controller
        Signal the Root to be shutdown. This method is intended to be called asynchronously and will return immediately - it will not wait for the Root to actually complete execution.
        Specified by:
        shutdown in interface Root.Controller
      • onQueueReceipt

        protected void onQueueReceipt()
        Called on receipt of a Packet (Call) or a Runnable task. The default implementation will call AbstractRoot.Delegate.onQueueReceipt() if a delegate is attached, or otherwise trigger an asynchronous poll of the queue.