Class ReceiverBase

    • Constructor Detail

      • ReceiverBase

        public ReceiverBase()
    • Method Detail

      • start

        public final void start()
        Specified by:
        start in interface LifeCycle
      • stop

        public final void stop()
        Specified by:
        stop in interface LifeCycle
      • isStarted

        public final boolean isStarted()
        Specified by:
        isStarted in interface LifeCycle
      • shouldStart

        protected abstract boolean shouldStart()
        Determines whether this receiver should start.

        Subclasses will implement this method to do any subclass-specific validation. The subclass's getRunnableTask() method will be invoked (and the task returned will be submitted to the executor) if and only if this method returns true

        Returns:
        flag indicating whether this receiver should start
      • onStop

        protected abstract void onStop()
        Allows a subclass to participate in receiver shutdown.
      • getRunnableTask

        protected abstract java.lang.Runnable getRunnableTask()
        Provides the runnable task this receiver will execute.
        Returns:
        runnable task