public abstract class GParsStm
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) static java.lang.String |
AN_EXCEPTION_WAS_EXPECTED_TO_BE_THROWN_FROM_UNWRAP_STM_CONTROL_ERROR_FOR |
private static java.lang.String |
CANNOT_CREATE_AN_ATOMIC_BLOCK_SOME_OF_THE_SPECIFIED_PARAMETERS_ARE_NOT_SUPPORTED |
private static org.multiverse.api.TxnExecutor |
defaultTxnExecutor
The atomic block to use when no block is specified explicitly
|
(package private) static java.lang.String |
THE_CODE_FOR_AN_ATOMIC_BLOCK_MUST_NOT_BE_NULL |
static org.multiverse.api.TxnFactoryBuilder |
transactionFactory
Gives access to multiverse TxnFactoryBuilder to allow customized creation of atomic blocks
|
Constructor and Description |
---|
GParsStm() |
Modifier and Type | Method and Description |
---|---|
static <T> T |
atomic(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.
|
static <T> T |
atomic(org.multiverse.api.TxnExecutor block,
groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.
|
static boolean |
atomicWithBoolean(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.
|
static boolean |
atomicWithBoolean(org.multiverse.api.TxnExecutor block,
groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.
|
static double |
atomicWithDouble(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.
|
static double |
atomicWithDouble(org.multiverse.api.TxnExecutor block,
groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.
|
static int |
atomicWithInt(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.
|
static int |
atomicWithInt(org.multiverse.api.TxnExecutor block,
groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.
|
static long |
atomicWithLong(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.
|
static long |
atomicWithLong(org.multiverse.api.TxnExecutor block,
groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.
|
static void |
atomicWithVoid(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.
|
static void |
atomicWithVoid(org.multiverse.api.TxnExecutor block,
groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.
|
static org.multiverse.api.TxnExecutor |
createTxnExecutor()
A factory method to create custom atomic blocks.
|
static org.multiverse.api.TxnExecutor |
createTxnExecutor(java.util.Map<java.lang.String,java.lang.Object> params)
A factory method to create custom atomic blocks allowing the caller to set desired transactional characteristics.
|
(package private) static void |
unwrapStmControlError(org.codehaus.groovy.runtime.InvokerInvocationException e)
Unwraps the multiverse control exceptions from Groovy exceptions
|
static final java.lang.String THE_CODE_FOR_AN_ATOMIC_BLOCK_MUST_NOT_BE_NULL
static final java.lang.String AN_EXCEPTION_WAS_EXPECTED_TO_BE_THROWN_FROM_UNWRAP_STM_CONTROL_ERROR_FOR
private static final java.lang.String CANNOT_CREATE_AN_ATOMIC_BLOCK_SOME_OF_THE_SPECIFIED_PARAMETERS_ARE_NOT_SUPPORTED
public static final org.multiverse.api.TxnFactoryBuilder transactionFactory
private static org.multiverse.api.TxnExecutor defaultTxnExecutor
public static org.multiverse.api.TxnExecutor createTxnExecutor()
public static org.multiverse.api.TxnExecutor createTxnExecutor(java.util.Map<java.lang.String,java.lang.Object> params)
params
- A map holding all values that should be specified. See the Multiverse documentation for possible valuespublic static <T> T atomic(groovy.lang.Closure code)
T
- The type or the return valuecode
- The code to run inside a transactionpublic static <T> T atomic(org.multiverse.api.TxnExecutor block, groovy.lang.Closure code)
T
- The type or the return valuecode
- The code to run inside a transactionpublic static int atomicWithInt(groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static int atomicWithInt(org.multiverse.api.TxnExecutor block, groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static long atomicWithLong(groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static long atomicWithLong(org.multiverse.api.TxnExecutor block, groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static boolean atomicWithBoolean(groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static boolean atomicWithBoolean(org.multiverse.api.TxnExecutor block, groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static double atomicWithDouble(groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static double atomicWithDouble(org.multiverse.api.TxnExecutor block, groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static void atomicWithVoid(groovy.lang.Closure code)
code
- The code to run inside a transactionpublic static void atomicWithVoid(org.multiverse.api.TxnExecutor block, groovy.lang.Closure code)
code
- The code to run inside a transactionstatic void unwrapStmControlError(org.codehaus.groovy.runtime.InvokerInvocationException e)
e
- The exception to unwrap from