Package org.nuxeo.runtime.cluster
Interface ClusterService
-
- All Known Implementing Classes:
ClusterServiceImpl
public interface ClusterService
Cluster Service, defining cluster node state and identity.- Since:
- 11.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getNodeId()
Returns the node id.boolean
isEnabled()
Checks if cluster mode is enabled.void
runAtomically(String key, Duration duration, Duration pollDelay, Runnable runnable)
Runs aRunnable
atomically in a cluster-wide critical section, outside a transaction.
-
-
-
Method Detail
-
isEnabled
boolean isEnabled()
Checks if cluster mode is enabled.- Returns:
true
if cluster mode is enabled,false
if 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 aRunnable
atomically 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
-
-