public interface ClusterProvider extends Provider
Modifier and Type | Interface and Description |
---|---|
static class |
ClusterProvider.DCNotify |
Modifier and Type | Method and Description |
---|---|
<T> ExecutionResult<T> |
executeIfNotExecuted(String taskKey,
int taskTimeoutInSeconds,
Callable<T> task)
Execute given task just if it's not already in progress (either on this or any other cluster node).
|
Future<Boolean> |
executeIfNotExecutedAsync(String taskKey,
int taskTimeoutInSeconds,
Callable task)
Execute given task just if it's not already in progress (either on this or any other cluster node).
|
int |
getClusterStartupTime()
Same value for all cluster nodes.
|
void |
notify(String taskKey,
ClusterEvent event,
boolean ignoreSender,
ClusterProvider.DCNotify dcNotify)
Notify registered listeners on all cluster nodes in all datacenters.
|
void |
registerListener(String taskKey,
ClusterListener task)
Register task (listener) under given key.
|
int getClusterStartupTime()
<T> ExecutionResult<T> executeIfNotExecuted(String taskKey, int taskTimeoutInSeconds, Callable<T> task)
T
- taskKey
- taskTimeoutInSeconds
- timeout for given task. If there is existing task in progress for longer time, it's considered outdated so we will start our task.task
- Future<Boolean> executeIfNotExecutedAsync(String taskKey, int taskTimeoutInSeconds, Callable task)
taskKey
- taskTimeoutInSeconds
- timeout for given task. If there is existing task in progress for longer time, it's considered outdated so we will start our task.task
- void registerListener(String taskKey, ClusterListener task)
taskKey
- task
- void notify(String taskKey, ClusterEvent event, boolean ignoreSender, ClusterProvider.DCNotify dcNotify)
taskKey
- event
- ignoreSender
- if true, then sender node itself won't receive the notificationdcNotify
- Specify which DCs to notify. See ClusterProvider.DCNotify
enum values for more infoCopyright © 2021 JBoss by Red Hat. All rights reserved.