public interface ExecutionManager
Modifier and Type | Method and Description |
---|---|
void |
executeOnce(java.lang.Runnable command)
Executes a runnable one time as soon as possible.
|
void |
executeOnce(java.lang.Runnable command,
long delay)
Excutes a runnable one time after a delay, specified in milliseconds
|
java.util.concurrent.ScheduledFuture<?> |
executeOnce(java.lang.Runnable command,
long delay,
java.util.concurrent.TimeUnit unit)
Executes the runnable once, after the specified delay.
|
void |
register(java.lang.String owner,
java.lang.String name,
java.lang.Runnable command,
int rateMS)
Registers a command to be executing repeatedly at the specified rate.
|
void |
register(java.lang.String owner,
java.lang.String name,
java.lang.Runnable command,
int rate,
java.util.concurrent.TimeUnit unit)
Registers a command to be executing repeatedly at the specified rate.
|
void |
register(java.lang.String owner,
java.lang.String name,
SelfSchedulingRunnable command)
Registers a self scheduling command to be executed.
|
void |
registerAtFixedRate(java.lang.String owner,
java.lang.String name,
java.lang.Runnable command,
int rate,
java.util.concurrent.TimeUnit unit)
Registers a command to be executed with a fixed rate rather than a fixed delay.
|
void |
registerAtFixedRateWithInitialDelay(java.lang.String owner,
java.lang.String name,
java.lang.Runnable command,
int rate,
java.util.concurrent.TimeUnit unit,
int initialDelay)
Registers a command to be executed with a fixed rate after some initial delay.
|
void |
registerWithInitialDelay(java.lang.String owner,
java.lang.String name,
java.lang.Runnable command,
int rate,
int initialDelay)
Registers a command to be executing repeatedly at the specified rate with an initial delay.
|
void |
registerWithInitialDelay(java.lang.String owner,
java.lang.String name,
java.lang.Runnable command,
int rate,
java.util.concurrent.TimeUnit unit,
int initialDelay)
Registers a command to be executing repeatedly at the specified rate with an initial delay.
|
java.util.concurrent.ScheduledFuture<?> |
scheduleWithFixedDelay(java.lang.Runnable command,
long initialDelay,
long delay,
java.util.concurrent.TimeUnit unit)
Schedules a runnable to execute with a fixed delay, and after an initial delay, much like
registerWithInitialDelay(String, String, Runnable, int, TimeUnit, int) . |
void |
shutdown()
Stops all execution gracefully.
|
void |
unRegister(java.lang.String owner,
java.lang.String name)
Unregisters a given command.
|
void |
unRegisterAll(java.lang.String owner)
Unregisters all commands for the given owner.
|
void register(java.lang.String owner, java.lang.String name, java.lang.Runnable command, int rateMS)
owner
- name of the "owner"- just a string qualifier for the command name.name
- identifier used in conjunction with the owner to identify the command.command
- Runnable to be called at the specified rate.rate
- The amount of time to wait in between invocations of the command, in milliseconds.void register(java.lang.String owner, java.lang.String name, java.lang.Runnable command, int rate, java.util.concurrent.TimeUnit unit)
owner
- name of the "owner"- just a string qualifier for the command name.name
- identifier used in conjunction with the owner to identify the command.command
- Runnable to be called at the specified rate.rate
- unit
- void register(java.lang.String owner, java.lang.String name, SelfSchedulingRunnable command)
owner
- name
- command
- void registerWithInitialDelay(java.lang.String owner, java.lang.String name, java.lang.Runnable command, int rate, int initialDelay)
owner
- name
- command
- rate
- initialDelay
- void registerWithInitialDelay(java.lang.String owner, java.lang.String name, java.lang.Runnable command, int rate, java.util.concurrent.TimeUnit unit, int initialDelay)
owner
- name
- command
- rate
- unit
- initialDelay
- void registerAtFixedRate(java.lang.String owner, java.lang.String name, java.lang.Runnable command, int rate, java.util.concurrent.TimeUnit unit)
owner
- name
- command
- rate
- unit
- void registerAtFixedRateWithInitialDelay(java.lang.String owner, java.lang.String name, java.lang.Runnable command, int rate, java.util.concurrent.TimeUnit unit, int initialDelay)
owner
- name
- command
- rate
- unit
- initialDelay
- void executeOnce(java.lang.Runnable command)
void executeOnce(java.lang.Runnable command, long delay)
java.util.concurrent.ScheduledFuture<?> executeOnce(java.lang.Runnable command, long delay, java.util.concurrent.TimeUnit unit)
command
- delay
- unit
- java.util.concurrent.ScheduledFuture<?> scheduleWithFixedDelay(java.lang.Runnable command, long initialDelay, long delay, java.util.concurrent.TimeUnit unit)
registerWithInitialDelay(String, String, Runnable, int, TimeUnit, int)
. The difference is that this
method returns a ScheduledFuture that can be used to cancel the task.void unRegister(java.lang.String owner, java.lang.String name)
owner
- name
- void unRegisterAll(java.lang.String owner)
owner
- void shutdown()