Package org.nuxeo.runtime.cluster
Interface ClusterService
- 
- All Known Implementing Classes:
 ClusterServiceImpl
public interface ClusterServiceCluster Service, defining cluster node state and identity.- Since:
 - 11.1
 
 
- 
- 
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetNodeId()Returns the node id.booleanisEnabled()Checks if cluster mode is enabled.voidrunAtomically(String key, Duration duration, Duration pollDelay, Runnable runnable)Runs aRunnableatomically in a cluster-wide critical section, outside a transaction. 
 - 
 
- 
- 
Method Detail
- 
isEnabled
boolean isEnabled()
Checks if cluster mode is enabled.- Returns:
 trueif cluster mode is enabled,falseif not
 
- 
getNodeId
@NotNull String getNodeId()
Returns the node id. This is nevernull.- Returns:
 - the node id
 
 
- 
runAtomically
void runAtomically(String key, Duration duration, Duration pollDelay, Runnable runnable)
Runs aRunnableatomically in a cluster-wide critical section, outside a transaction.- Parameters:
 key- the key used to determine atomicityduration- the duration during which we attempt to acquire the lockpollDelay- the delay between two subsequent polls of the lockrunnable- the runnable- Throws:
 RuntimeServiceException- if locking failed
 
 - 
 
 -