Class CuratorMultiTransactionImpl
- java.lang.Object
-
- org.apache.curator.framework.imps.CuratorMultiTransactionImpl
-
- All Implemented Interfaces:
Backgroundable<ErrorListenerMultiTransactionMain>,ErrorListenerMultiTransactionMain,CuratorMultiTransaction,CuratorMultiTransactionMain
public class CuratorMultiTransactionImpl extends java.lang.Object implements CuratorMultiTransaction, CuratorMultiTransactionMain, ErrorListenerMultiTransactionMain
-
-
Constructor Summary
Constructors Constructor Description CuratorMultiTransactionImpl(CuratorFrameworkImpl client)CuratorMultiTransactionImpl(CuratorFrameworkImpl client, Backgrounding backgrounding)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CuratorTransactionResult>forOperations(java.util.List<CuratorOp> operations)Commit the given operations as a single transaction.java.util.List<CuratorTransactionResult>forOperations(CuratorOp... operations)Commit the given operations as a single transaction.ErrorListenerMultiTransactionMaininBackground()Perform the action in the backgroundErrorListenerMultiTransactionMaininBackground(java.lang.Object context)Perform the action in the backgroundErrorListenerMultiTransactionMaininBackground(BackgroundCallback callback)Perform the action in the backgroundErrorListenerMultiTransactionMaininBackground(BackgroundCallback callback, java.lang.Object context)Perform the action in the backgroundErrorListenerMultiTransactionMaininBackground(BackgroundCallback callback, java.lang.Object context, java.util.concurrent.Executor executor)Perform the action in the backgroundErrorListenerMultiTransactionMaininBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)Perform the action in the backgroundvoidperformBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.CuratorMultiTransactionRecord> operationAndData)CuratorMultiTransactionMainwithUnhandledErrorListener(UnhandledErrorListener listener)Set an error listener for this background operation.
-
-
-
Constructor Detail
-
CuratorMultiTransactionImpl
public CuratorMultiTransactionImpl(CuratorFrameworkImpl client)
-
CuratorMultiTransactionImpl
public CuratorMultiTransactionImpl(CuratorFrameworkImpl client, Backgrounding backgrounding)
-
-
Method Detail
-
inBackground
public ErrorListenerMultiTransactionMain inBackground()
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerMultiTransactionMain>- Returns:
- this
-
inBackground
public ErrorListenerMultiTransactionMain inBackground(java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerMultiTransactionMain>- Parameters:
context- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public ErrorListenerMultiTransactionMain inBackground(BackgroundCallback callback)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerMultiTransactionMain>- Parameters:
callback- a functor that will get called when the operation has completed- Returns:
- this
-
inBackground
public ErrorListenerMultiTransactionMain inBackground(BackgroundCallback callback, java.lang.Object context)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerMultiTransactionMain>- Parameters:
callback- a functor that will get called when the operation has completedcontext- context object - will be available from the event sent to the listener- Returns:
- this
-
inBackground
public ErrorListenerMultiTransactionMain inBackground(BackgroundCallback callback, java.util.concurrent.Executor executor)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerMultiTransactionMain>- Parameters:
callback- a functor that will get called when the operation has completedexecutor- executor to use for the background call- Returns:
- this
-
inBackground
public ErrorListenerMultiTransactionMain inBackground(BackgroundCallback callback, java.lang.Object context, java.util.concurrent.Executor executor)
Description copied from interface:BackgroundablePerform the action in the background- Specified by:
inBackgroundin interfaceBackgroundable<ErrorListenerMultiTransactionMain>- Parameters:
callback- a functor that will get called when the operation has completedcontext- context object - will be available from the event sent to the listenerexecutor- executor to use for the background call- Returns:
- this
-
withUnhandledErrorListener
public CuratorMultiTransactionMain withUnhandledErrorListener(UnhandledErrorListener listener)
Description copied from interface:ErrorListenerMultiTransactionMainSet an error listener for this background operation. If an exception occurs while processing the call in the background, this listener will be called- Specified by:
withUnhandledErrorListenerin interfaceErrorListenerMultiTransactionMain- Parameters:
listener- the listener- Returns:
- this for chaining
-
forOperations
public java.util.List<CuratorTransactionResult> forOperations(CuratorOp... operations) throws java.lang.Exception
Description copied from interface:CuratorMultiTransactionMainCommit the given operations as a single transaction. Create the operation instances viaCuratorFramework.transactionOp()- Specified by:
forOperationsin interfaceCuratorMultiTransactionMain- Parameters:
operations- operations that make up the transaction.- Returns:
- result details for foreground operations or
nullfor background operations - Throws:
java.lang.Exception- errors
-
forOperations
public java.util.List<CuratorTransactionResult> forOperations(java.util.List<CuratorOp> operations) throws java.lang.Exception
Description copied from interface:CuratorMultiTransactionMainCommit the given operations as a single transaction. Create the operation instances viaCuratorFramework.transactionOp()- Specified by:
forOperationsin interfaceCuratorMultiTransactionMain- Parameters:
operations- operations that make up the transaction.- Returns:
- result details for foreground operations or
nullfor background operations - Throws:
java.lang.Exception- errors
-
performBackgroundOperation
public void performBackgroundOperation(org.apache.curator.framework.imps.OperationAndData<org.apache.curator.framework.imps.CuratorMultiTransactionRecord> operationAndData) throws java.lang.Exception- Throws:
java.lang.Exception
-
-