Package org.nuxeo.runtime.cluster
Class ClusterServiceImpl.ClusterLockHelper
java.lang.Object
org.nuxeo.runtime.cluster.ClusterServiceImpl.ClusterLockHelper
- Enclosing class:
- ClusterServiceImpl
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Duration
static final String
protected final KeyValueStore
protected final String
protected final Duration
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
void
runAtomically
(String key, Runnable runnable) Runs aRunnable
atomically in a cluster-wide critical section, outside a transaction.protected void
runAtomicallyInternal
(String key, Runnable runnable) Runs aRunnable
atomically, in a cluster-wide critical section.protected void
runInSeparateTransaction
(Runnable runnable) Runs aRunnable
outside the current transaction (committing and finally restarting it if needed).protected String
protected void
-
Field Details
-
KV_STORE_NAME
- See Also:
-
nodeId
-
duration
-
pollDelay
-
kvStore
-
-
Constructor Details
-
ClusterLockHelper
-
-
Method Details
-
runAtomically
Runs aRunnable
atomically in a cluster-wide critical section, outside a transaction. -
runInSeparateTransaction
Runs aRunnable
outside the current transaction (committing and finally restarting it if needed).- Implementation Requirements:
- this is different from
TransactionHelper.runWithoutTransaction(Runnable)
because that one, in some implementations, may keep the current transaction and start the runnable in a new thread. Here we don't want a new thread or a risk of deadlock, so we just commit the original transaction.
-
runAtomicallyInternal
Runs aRunnable
atomically, in a cluster-wide critical section. -
tryLock
-
unLock
-
getLock
-