public class InfinispanClusterProvider extends Object implements ClusterProvider
| Modifier and Type | Field and Description |
|---|---|
static String |
CLUSTER_STARTUP_TIME_KEY |
protected static org.jboss.logging.Logger |
logger |
| Constructor and Description |
|---|
InfinispanClusterProvider(InfinispanClusterProviderFactory factory,
KeycloakSession session,
org.infinispan.Cache<String,Serializable> cache) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
<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).
|
int |
getClusterStartupTime()
Same value for all cluster nodes.
|
void |
notify(String taskKey,
ClusterEvent event)
Notify registered listeners on all cluster nodes
|
void |
registerListener(String taskKey,
ClusterListener task)
Register task (listener) under given key.
|
protected static final org.jboss.logging.Logger logger
public static final String CLUSTER_STARTUP_TIME_KEY
public InfinispanClusterProvider(InfinispanClusterProviderFactory factory, KeycloakSession session, org.infinispan.Cache<String,Serializable> cache)
public int getClusterStartupTime()
ClusterProvidergetClusterStartupTime in interface ClusterProviderpublic <T> ExecutionResult<T> executeIfNotExecuted(String taskKey, int taskTimeoutInSeconds, Callable<T> task)
ClusterProviderexecuteIfNotExecuted in interface ClusterProvidertaskTimeoutInSeconds - timeout for given task. If there is existing task in progress for longer time, it's considered outdated so we will start our task.public void registerListener(String taskKey, ClusterListener task)
ClusterProviderregisterListener in interface ClusterProviderpublic void notify(String taskKey, ClusterEvent event)
ClusterProvidernotify in interface ClusterProviderCopyright © 2016 JBoss by Red Hat. All rights reserved.