groovyx.gpars.stm
Class GParsStm

java.lang.Object
  extended by groovyx.gpars.stm.GParsStm

public abstract class GParsStm
extends java.lang.Object

Provides access to GPars Stm services.

Author:
Vaclav Pech

Field Summary
(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.AtomicBlock defaultAtomicBlock
          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.TransactionFactoryBuilder transactionFactory
          Gives access to multiverse TransactionFactoryBuilder to allow customized creation of atomic blocks
 
Constructor Summary
GParsStm()
           
 
Method Summary
static
<T> T
atomic(org.multiverse.api.AtomicBlock block, groovy.lang.Closure code)
          Performs the supplied code atomically within a transaction using the supplied atomic block.
static
<T> T
atomic(groovy.lang.Closure code)
          Performs the supplied code atomically within a transaction.
static boolean atomicWithBoolean(org.multiverse.api.AtomicBlock 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 double atomicWithDouble(org.multiverse.api.AtomicBlock 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 int atomicWithInt(org.multiverse.api.AtomicBlock 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 long atomicWithLong(org.multiverse.api.AtomicBlock 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 void atomicWithVoid(org.multiverse.api.AtomicBlock 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 org.multiverse.api.AtomicBlock createAtomicBlock()
          A factory method to create custom atomic blocks.
static org.multiverse.api.AtomicBlock createAtomicBlock(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

THE_CODE_FOR_AN_ATOMIC_BLOCK_MUST_NOT_BE_NULL

static final java.lang.String THE_CODE_FOR_AN_ATOMIC_BLOCK_MUST_NOT_BE_NULL
See Also:
Constant Field Values

AN_EXCEPTION_WAS_EXPECTED_TO_BE_THROWN_FROM_UNWRAP_STM_CONTROL_ERROR_FOR

static final java.lang.String AN_EXCEPTION_WAS_EXPECTED_TO_BE_THROWN_FROM_UNWRAP_STM_CONTROL_ERROR_FOR
See Also:
Constant Field Values

CANNOT_CREATE_AN_ATOMIC_BLOCK_SOME_OF_THE_SPECIFIED_PARAMETERS_ARE_NOT_SUPPORTED

private static final java.lang.String CANNOT_CREATE_AN_ATOMIC_BLOCK_SOME_OF_THE_SPECIFIED_PARAMETERS_ARE_NOT_SUPPORTED
See Also:
Constant Field Values

transactionFactory

public static final org.multiverse.api.TransactionFactoryBuilder transactionFactory
Gives access to multiverse TransactionFactoryBuilder to allow customized creation of atomic blocks


defaultAtomicBlock

private static final org.multiverse.api.AtomicBlock defaultAtomicBlock
The atomic block to use when no block is specified explicitly

Constructor Detail

GParsStm

public GParsStm()
Method Detail

createAtomicBlock

public static org.multiverse.api.AtomicBlock createAtomicBlock()
A factory method to create custom atomic blocks.

Returns:
The newly created instance of AtomicBlock

createAtomicBlock

public static org.multiverse.api.AtomicBlock createAtomicBlock(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.

Parameters:
params - A map holding all values that should be specified. See the Multiverse documentation for possible values
Returns:
The newly created instance of AtomicBlock

atomic

public static <T> T atomic(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.

Type Parameters:
T - The type or the return value
Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomic

public static <T> T atomic(org.multiverse.api.AtomicBlock block,
                           groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.

Type Parameters:
T - The type or the return value
Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithInt

public static int atomicWithInt(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithInt

public static int atomicWithInt(org.multiverse.api.AtomicBlock block,
                                groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithLong

public static long atomicWithLong(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithLong

public static long atomicWithLong(org.multiverse.api.AtomicBlock block,
                                  groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithBoolean

public static boolean atomicWithBoolean(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithBoolean

public static boolean atomicWithBoolean(org.multiverse.api.AtomicBlock block,
                                        groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithDouble

public static double atomicWithDouble(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithDouble

public static double atomicWithDouble(org.multiverse.api.AtomicBlock block,
                                      groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.

Parameters:
code - The code to run inside a transaction
Returns:
The result returned from the supplied code when run in a transaction

atomicWithVoid

public static void atomicWithVoid(groovy.lang.Closure code)
Performs the supplied code atomically within a transaction.

Parameters:
code - The code to run inside a transaction

atomicWithVoid

public static void atomicWithVoid(org.multiverse.api.AtomicBlock block,
                                  groovy.lang.Closure code)
Performs the supplied code atomically within a transaction using the supplied atomic block.

Parameters:
code - The code to run inside a transaction

unwrapStmControlError

static void unwrapStmControlError(org.codehaus.groovy.runtime.InvokerInvocationException e)
Unwraps the multiverse control exceptions from Groovy exceptions

Parameters:
e - The exception to unwrap from

Copyright © 2008–2010 Václav Pech. All Rights Reserved.