Package org.nuxeo.runtime.cluster
Class ClusterServiceImpl.ClusterLockHelper
java.lang.Object
org.nuxeo.runtime.cluster.ClusterServiceImpl.ClusterLockHelper
- Enclosing class:
ClusterServiceImpl
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Durationstatic final Stringprotected final KeyValueStoreprotected final Stringprotected final Duration -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringvoidrunAtomically(String key, Runnable runnable) Runs aRunnableatomically in a cluster-wide critical section, outside a transaction.protected voidrunAtomicallyInternal(String key, Runnable runnable) Runs aRunnableatomically, in a cluster-wide critical section.protected voidrunInSeparateTransaction(Runnable runnable) Runs aRunnableoutside the current transaction (committing and finally restarting it if needed).protected Stringprotected void
-
Field Details
-
KV_STORE_NAME
- See Also:
-
nodeId
-
duration
-
pollDelay
-
kvStore
-
-
Constructor Details
-
ClusterLockHelper
-
-
Method Details
-
runAtomically
Runs aRunnableatomically in a cluster-wide critical section, outside a transaction. -
runInSeparateTransaction
Runs aRunnableoutside 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 aRunnableatomically, in a cluster-wide critical section. -
tryLock
-
unLock
-
getLock
-