Package org.redisson.transaction
Class RedissonTransaction
java.lang.Object
org.redisson.transaction.RedissonTransaction
- All Implemented Interfaces:
RTransaction
- Author:
- Nikita Koksharov
-
Constructor Summary
ConstructorsConstructorDescriptionRedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options) RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options, List<TransactionalOperation> operations, Set<String> localCaches) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidvoidcommit()Commits all changes made on this transaction.voidcommit(Set<String> localCaches, List<TransactionalOperation> operations) Commits all changes made on this transaction in async mode.protected static String<V> RBucket<V>Returns transactional object holder instance by name.<V> RBucket<V>Returns transactional object holder instance by name using provided codec for object.Returns transactional interface for mass operations with Bucket objects.getBuckets(Codec codec) Returns transactional interface for mass operations with Bucket objects using provided codec for object.<K,V> RLocalCachedMap<K, V> getLocalCachedMap(RLocalCachedMap<K, V> fromInstance) Returns transactional local cached map proxy for specified local cached map instance.<K,V> RMap<K, V> Returns transactional map instance by name.<K,V> RMap<K, V> Returns transactional map instance by name using provided codec for both map keys and values.<K,V> RMapCache<K, V> getMapCache(String name) Returns transactional map-based cache instance by name.<K,V> RMapCache<K, V> getMapCache(String name, Codec codec) Returns transactional map-based cache instance bynameusing providedcodecfor both cache keys and values.<V> RSet<V>Returns transactional set instance by name.<V> RSet<V>Returns transactional set instance by name using provided codec for set objects.<V> RSetCache<V>getSetCache(String name) Returns transactional set-based cache instance byname.<V> RSetCache<V>getSetCache(String name, Codec codec) Returns transactional set-based cache instance byname.voidrollback()Rollback all changes made on this transaction.voidrollback(List<TransactionalOperation> operations) Rollback all changes made on this transaction in async mode.
-
Constructor Details
-
RedissonTransaction
-
RedissonTransaction
public RedissonTransaction(CommandAsyncExecutor commandExecutor, TransactionOptions options, List<TransactionalOperation> operations, Set<String> localCaches)
-
-
Method Details
-
getLocalCachedMap
Description copied from interface:RTransactionReturns transactional local cached map proxy for specified local cached map instance.- Specified by:
getLocalCachedMapin interfaceRTransaction- Type Parameters:
K- type of keyV- type of value- Parameters:
fromInstance- - local cache map instance- Returns:
- LocalCachedMap object
-
getBucket
Description copied from interface:RTransactionReturns transactional object holder instance by name.- Specified by:
getBucketin interfaceRTransaction- Type Parameters:
V- type of value- Parameters:
name- - name of object- Returns:
- Bucket object
-
getBucket
Description copied from interface:RTransactionReturns transactional object holder instance by name using provided codec for object.- Specified by:
getBucketin interfaceRTransaction- Type Parameters:
V- type of value- Parameters:
name- - name of objectcodec- - codec for values- Returns:
- Bucket object
-
getBuckets
Description copied from interface:RTransactionReturns transactional interface for mass operations with Bucket objects.- Specified by:
getBucketsin interfaceRTransaction- Returns:
- Buckets
-
getBuckets
Description copied from interface:RTransactionReturns transactional interface for mass operations with Bucket objects using provided codec for object.- Specified by:
getBucketsin interfaceRTransaction- Parameters:
codec- - codec for bucket objects- Returns:
- Buckets
-
getSet
Description copied from interface:RTransactionReturns transactional set instance by name.- Specified by:
getSetin interfaceRTransaction- Type Parameters:
V- type of value- Parameters:
name- - name of object- Returns:
- Set object
-
getSet
Description copied from interface:RTransactionReturns transactional set instance by name using provided codec for set objects.- Specified by:
getSetin interfaceRTransaction- Type Parameters:
V- type of value- Parameters:
name- - name of objectcodec- - codec for values- Returns:
- Set object
-
getSetCache
Description copied from interface:RTransactionReturns transactional set-based cache instance byname. Supports value eviction with a given TTL value.If eviction is not required then it's better to use regular map
RTransaction.getSet(String).- Specified by:
getSetCachein interfaceRTransaction- Type Parameters:
V- type of value- Parameters:
name- - name of object- Returns:
- SetCache object
-
getSetCache
Description copied from interface:RTransactionReturns transactional set-based cache instance byname. Supports value eviction with a given TTL value.If eviction is not required then it's better to use regular map
RTransaction.getSet(String, Codec).- Specified by:
getSetCachein interfaceRTransaction- Type Parameters:
V- type of value- Parameters:
name- - name of objectcodec- - codec for values- Returns:
- SetCache object
-
getMap
Description copied from interface:RTransactionReturns transactional map instance by name.- Specified by:
getMapin interfaceRTransaction- Type Parameters:
K- type of keyV- type of value- Parameters:
name- - name of object- Returns:
- Map object
-
getMap
Description copied from interface:RTransactionReturns transactional map instance by name using provided codec for both map keys and values.- Specified by:
getMapin interfaceRTransaction- Type Parameters:
K- type of keyV- type of value- Parameters:
name- - name of objectcodec- - codec for keys and values- Returns:
- Map object
-
getMapCache
Description copied from interface:RTransactionReturns transactional map-based cache instance by name. Supports entry eviction with a given MaxIdleTime and TTL settings.If eviction is not required then it's better to use regular map
RTransaction.getMap(String).- Specified by:
getMapCachein interfaceRTransaction- Type Parameters:
K- type of keyV- type of value- Parameters:
name- - name of object- Returns:
- MapCache object
-
getMapCache
Description copied from interface:RTransactionReturns transactional map-based cache instance bynameusing providedcodecfor both cache keys and values. Supports entry eviction with a given MaxIdleTime and TTL settings.If eviction is not required then it's better to use regular map
RTransaction.getMap(String, Codec).- Specified by:
getMapCachein interfaceRTransaction- Type Parameters:
K- type of keyV- type of value- Parameters:
name- - object namecodec- - codec for keys and values- Returns:
- MapCache object
-
commitAsync
Description copied from interface:RTransactionCommits all changes made on this transaction in async mode.- Specified by:
commitAsyncin interfaceRTransaction- Returns:
- void
-
commit
public void commit()Description copied from interface:RTransactionCommits all changes made on this transaction.- Specified by:
commitin interfaceRTransaction
-
commit
-
generateId
-
rollback
public void rollback()Description copied from interface:RTransactionRollback all changes made on this transaction.- Specified by:
rollbackin interfaceRTransaction
-
rollback
-
rollbackAsync
Description copied from interface:RTransactionRollback all changes made on this transaction in async mode.- Specified by:
rollbackAsyncin interfaceRTransaction- Returns:
- void
-
getLocalCaches
-
getOperations
-
checkState
protected void checkState()
-