Class RunnableAgent<K,​V,​A extends Agent<K,​V> & Runnable>

    • Constructor Detail

      • RunnableAgent

        public RunnableAgent​(A agent)
    • Method Detail

      • run

        protected abstract Runnable run​(Runnable runnable)
        This method is used to run the task and return a Runnable to cancel it
        Parameters:
        runnable - the task to run
        Returns:
        the Runnable to cancel the task
      • start

        public void start()
        Specified by:
        start in interface Agent<K,​V>
      • stop

        public void stop()
        Specified by:
        stop in interface Agent<K,​V>
      • beforeStop

        public void beforeStop()
        Specified by:
        beforeStop in interface Agent<K,​V>
      • getAgent

        public A getAgent()