public abstract class ActiveMQScheduledComponent extends Object implements ActiveMQComponent, Runnable
| Constructor and Description |
|---|
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. |
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. |
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. |
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. |
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. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
delay()
A delay request can succeed only if:
there is no other pending delay request
there is no pending execution request
|
long |
getInitialDelay() |
long |
getPeriod() |
protected ActiveMQThreadFactory |
getThreadFactory() |
TimeUnit |
getTimeUnit() |
boolean |
isStarted() |
ActiveMQScheduledComponent |
setInitialDelay(long initialDelay) |
ActiveMQScheduledComponent |
setInitialDelayAndPeriod(long initialDelay,
long period)
Useful to change a running schedule and avoid multiple restarts.
|
ActiveMQScheduledComponent |
setInitialDelayAndPeriod(long initialDelay,
long period,
TimeUnit timeUnit)
Useful to change a running schedule and avoid multiple restarts.
|
ActiveMQScheduledComponent |
setPeriod(long period) |
ActiveMQScheduledComponent |
setPeriod(long period,
TimeUnit unit) |
ActiveMQScheduledComponent |
setTimeUnit(TimeUnit timeUnit) |
void |
start() |
void |
stop() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasyncStoppublic ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorService, Executor executor, long initialDelay, long checkPeriod, TimeUnit timeUnit, boolean onDemand)
Runnable.run() with a fixed checkPeriod on a configured executor.scheduledExecutorService - the ScheduledExecutorService that periodically trigger Runnable.run() on the configured executorexecutor - the Executor that execute Runnable.run() when triggeredinitialDelay - the time to delay first executioncheckPeriod - the delay between the termination of one execution and the start of the nexttimeUnit - the time unit of the initialDelay and checkPeriod parametersonDemand - if true the task won't be scheduled on start(), false otherwisepublic ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorService, long initialDelay, long checkPeriod, TimeUnit timeUnit, boolean onDemand)
Runnable.run() with a fixed checkPeriod on a configured executor.scheduledExecutorService - the ScheduledExecutorService that periodically trigger Runnable.run() on the configured executorinitialDelay - the time to delay first executioncheckPeriod - the delay between the termination of one execution and the start of the nexttimeUnit - the time unit of the initialDelay and checkPeriod parametersonDemand - if true the task won't be scheduled on start(), false otherwisepublic ActiveMQScheduledComponent(ScheduledExecutorService scheduledExecutorService, Executor executor, long checkPeriod, TimeUnit timeUnit, boolean onDemand)
Runnable.run() with a fixed checkPeriod on a configured executor.
The component created will have initialDelay defaulted to checkPeriod.
scheduledExecutorService - the ScheduledExecutorService that periodically trigger Runnable.run() on the configured executorexecutor - the Executor that execute Runnable.run() when triggeredcheckPeriod - the delay between the termination of one execution and the start of the nexttimeUnit - the time unit of the initialDelay and checkPeriod parametersonDemand - if true the task won't be scheduled on start(), false otherwisepublic ActiveMQScheduledComponent(long initialDelay,
long checkPeriod,
TimeUnit timeUnit,
boolean onDemand)
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.
initialDelay - the time to delay first executioncheckPeriod - the delay between the termination of one execution and the start of the nexttimeUnit - the time unit of the initialDelay and checkPeriod parametersonDemand - if true the task won't be scheduled on start(), false otherwisepublic ActiveMQScheduledComponent(long checkPeriod,
TimeUnit timeUnit,
boolean onDemand)
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.
checkPeriod - the delay between the termination of one execution and the start of the nexttimeUnit - the time unit of the initialDelay and checkPeriod parametersonDemand - if true the task won't be scheduled on start(), false otherwisepublic void start()
start in interface ActiveMQComponentprotected ActiveMQThreadFactory getThreadFactory()
public boolean delay()
When a delay request succeed it schedule a new execution to happen in getPeriod().
public long getPeriod()
public ActiveMQScheduledComponent setPeriod(long period)
public ActiveMQScheduledComponent setPeriod(long period, TimeUnit unit)
public long getInitialDelay()
public ActiveMQScheduledComponent setInitialDelay(long initialDelay)
public ActiveMQScheduledComponent setInitialDelayAndPeriod(long initialDelay, long period)
public ActiveMQScheduledComponent setInitialDelayAndPeriod(long initialDelay, long period, TimeUnit timeUnit)
public TimeUnit getTimeUnit()
public ActiveMQScheduledComponent setTimeUnit(TimeUnit timeUnit)
public void stop()
stop in interface ActiveMQComponentpublic boolean isStarted()
isStarted in interface ActiveMQComponentCopyright © 2021 JBoss by Red Hat. All rights reserved.