Class ActiveMQScheduledComponent

    • Constructor Detail

      • ActiveMQScheduledComponent

        public ActiveMQScheduledComponent​(ScheduledExecutorService scheduledExecutorService,
                                          Executor executor,
                                          long initialDelay,
                                          long checkPeriod,
                                          TimeUnit timeUnit,
                                          boolean onDemand)
        It creates a scheduled component that can trigger Runnable.run() with a fixed checkPeriod on a configured executor.
        Parameters:
        scheduledExecutorService - the ScheduledExecutorService that periodically trigger Runnable.run() on the configured executor
        executor - the Executor that execute Runnable.run() when triggered
        initialDelay - the time to delay first execution
        checkPeriod - the delay between the termination of one execution and the start of the next
        timeUnit - the time unit of the initialDelay and checkPeriod parameters
        onDemand - if true the task won't be scheduled on start(), false otherwise
      • ActiveMQScheduledComponent

        public ActiveMQScheduledComponent​(ScheduledExecutorService scheduledExecutorService,
                                          long initialDelay,
                                          long checkPeriod,
                                          TimeUnit timeUnit,
                                          boolean onDemand)
        It creates a scheduled component that can trigger Runnable.run() with a fixed checkPeriod on a configured executor.
        Parameters:
        scheduledExecutorService - the ScheduledExecutorService that periodically trigger Runnable.run() on the configured executor
        initialDelay - the time to delay first execution
        checkPeriod - the delay between the termination of one execution and the start of the next
        timeUnit - the time unit of the initialDelay and checkPeriod parameters
        onDemand - if true the task won't be scheduled on start(), false otherwise
      • ActiveMQScheduledComponent

        public ActiveMQScheduledComponent​(ScheduledExecutorService scheduledExecutorService,
                                          Executor executor,
                                          long checkPeriod,
                                          TimeUnit timeUnit,
                                          boolean onDemand)
        It creates a scheduled component that can trigger Runnable.run() with a fixed checkPeriod on a configured executor.

        The component created will have initialDelay defaulted to checkPeriod.

        Parameters:
        scheduledExecutorService - the ScheduledExecutorService that periodically trigger Runnable.run() on the configured executor
        executor - the Executor that execute Runnable.run() when triggered
        checkPeriod - the delay between the termination of one execution and the start of the next
        timeUnit - the time unit of the initialDelay and checkPeriod parameters
        onDemand - if true the task won't be scheduled on start(), false otherwise
      • ActiveMQScheduledComponent

        public ActiveMQScheduledComponent​(long initialDelay,
                                          long checkPeriod,
                                          TimeUnit timeUnit,
                                          boolean onDemand)
        It creates a scheduled component that can trigger Runnable.run() with a fixed checkPeriod on a configured executor.

        This is useful for cases where we want our own scheduler executor: on start() it will create a fresh new single-threaded ScheduledExecutorService using getThreadFactory() and getThisClassLoader(), while on stop() it will garbage it.

        Parameters:
        initialDelay - the time to delay first execution
        checkPeriod - the delay between the termination of one execution and the start of the next
        timeUnit - the time unit of the initialDelay and checkPeriod parameters
        onDemand - if true the task won't be scheduled on start(), false otherwise
      • ActiveMQScheduledComponent

        public ActiveMQScheduledComponent​(long checkPeriod,
                                          TimeUnit timeUnit,
                                          boolean onDemand)
        It creates a scheduled component that can trigger Runnable.run() with a fixed checkPeriod on a configured executor.

        This is useful for cases where we want our own scheduler executor. The component created will have initialDelay defaulted to checkPeriod.

        Parameters:
        checkPeriod - the delay between the termination of one execution and the start of the next
        timeUnit - the time unit of the initialDelay and checkPeriod parameters
        onDemand - if true the task won't be scheduled on start(), false otherwise