Class AbstractThreadedTcDataLink

  • All Implemented Interfaces:
    com.google.common.util.concurrent.Service, Runnable, SystemParametersProducer, Link, TcDataLink
    Direct Known Subclasses:
    TcpTcDataLink, UdpTcDataLink

    public abstract class AbstractThreadedTcDataLink
    extends AbstractTcDataLink
    implements Runnable
    Abstract link that starts a thread when it's enabled and stops it when it's disabled.

    The startUp() and shutDown() methods are called at startup/enable and shutdown/disable times on the working thread.

    This class provides queueing and rate limiting function.

    args:

    • tcQueueSize: maximum size of the queue. If the queue is full, the commands will be rejected. If the argument is not specified, the queue will be unlimited in size.
    • tcMaxRate: maximum number of commands to send per second.
    • Constructor Detail

      • AbstractThreadedTcDataLink

        public AbstractThreadedTcDataLink()
    • Method Detail

      • doStart

        protected void doStart()
        Specified by:
        doStart in class com.google.common.util.concurrent.AbstractService
      • doStop

        protected void doStop()
        Specified by:
        doStop in class com.google.common.util.concurrent.AbstractService
      • run

        public void run()
        Specified by:
        run in interface Runnable
      • startUp

        protected abstract void startUp()
                                 throws Exception
        Called at start up (if the link is enabled) or when the link is enabled
        Throws:
        Exception
      • shutDown

        protected abstract void shutDown()
                                  throws Exception
        Called at shutdown (if the link is enabled) or when the link is disabled
        Throws:
        Exception