Package org.redisson.transaction
Class RedissonTransaction
java.lang.Object
org.redisson.transaction.RedissonTransaction
- All Implemented Interfaces:
RTransaction
- Author:
- Nikita Koksharov
-
Constructor Summary
ConstructorDescriptionRedissonTransaction
(CommandAsyncExecutor commandExecutor, TransactionOptions options) RedissonTransaction
(CommandAsyncExecutor commandExecutor, TransactionOptions options, List<TransactionalOperation> operations, Set<String> localCaches) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
commit()
Commits all changes made on this transaction.void
commit
(Set<String> localCaches, List<TransactionalOperation> operations) Commits all changes made on this transaction in async mode.<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 byname
using providedcodec
for 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
.void
rollback()
Rollback all changes made on this transaction.void
rollback
(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:RTransaction
Returns transactional local cached map proxy for specified local cached map instance.- Specified by:
getLocalCachedMap
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
fromInstance
- - local cache map instance- Returns:
- LocalCachedMap object
-
getBucket
Description copied from interface:RTransaction
Returns transactional object holder instance by name.- Specified by:
getBucket
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of object- Returns:
- Bucket object
-
getBucket
Description copied from interface:RTransaction
Returns transactional object holder instance by name using provided codec for object.- Specified by:
getBucket
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of objectcodec
- - codec for values- Returns:
- Bucket object
-
getBuckets
Description copied from interface:RTransaction
Returns transactional interface for mass operations with Bucket objects.- Specified by:
getBuckets
in interfaceRTransaction
- Returns:
- Buckets
-
getBuckets
Description copied from interface:RTransaction
Returns transactional interface for mass operations with Bucket objects using provided codec for object.- Specified by:
getBuckets
in interfaceRTransaction
- Parameters:
codec
- - codec for bucket objects- Returns:
- Buckets
-
getSet
Description copied from interface:RTransaction
Returns transactional set instance by name.- Specified by:
getSet
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of object- Returns:
- Set object
-
getSet
Description copied from interface:RTransaction
Returns transactional set instance by name using provided codec for set objects.- Specified by:
getSet
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of objectcodec
- - codec for values- Returns:
- Set object
-
getSetCache
Description copied from interface:RTransaction
Returns 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:
getSetCache
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of object- Returns:
- SetCache object
-
getSetCache
Description copied from interface:RTransaction
Returns 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:
getSetCache
in interfaceRTransaction
- Type Parameters:
V
- type of value- Parameters:
name
- - name of objectcodec
- - codec for values- Returns:
- SetCache object
-
getMap
Description copied from interface:RTransaction
Returns transactional map instance by name.- Specified by:
getMap
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
name
- - name of object- Returns:
- Map object
-
getMap
Description copied from interface:RTransaction
Returns transactional map instance by name using provided codec for both map keys and values.- Specified by:
getMap
in 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:RTransaction
Returns 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:
getMapCache
in interfaceRTransaction
- Type Parameters:
K
- type of keyV
- type of value- Parameters:
name
- - name of object- Returns:
- MapCache object
-
getMapCache
Description copied from interface:RTransaction
Returns transactional map-based cache instance byname
using providedcodec
for 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:
getMapCache
in 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:RTransaction
Commits all changes made on this transaction in async mode.- Specified by:
commitAsync
in interfaceRTransaction
- Returns:
- void
-
commit
public void commit()Description copied from interface:RTransaction
Commits all changes made on this transaction.- Specified by:
commit
in interfaceRTransaction
-
commit
-
rollback
public void rollback()Description copied from interface:RTransaction
Rollback all changes made on this transaction.- Specified by:
rollback
in interfaceRTransaction
-
rollback
-
rollbackAsync
Description copied from interface:RTransaction
Rollback all changes made on this transaction in async mode.- Specified by:
rollbackAsync
in interfaceRTransaction
- Returns:
- void
-
getLocalCaches
-
getOperations
-
checkState
protected void checkState()
-