STM
Java-friendly API for ScalaSTM. These methods can also be statically imported.
Java-friendly API for ScalaSTM. These methods can also be statically imported.
Type members
Classlikes
Value members
Concrete methods
Add a task to run after the current transaction has committed.
Add a task to run after the current transaction has committed.
- Value Params
- task
the
Runnable
task to run after transaction commit
- Throws
- IllegalStateException
if called from outside a transaction
Add a task to run after the current transaction has either rolled back or committed.
Add a task to run after the current transaction has either rolled back or committed.
- Value Params
- task
the
Runnable
task to run after transaction completion
- Throws
- IllegalStateException
if called from outside a transaction
Add a task to run after the current transaction has rolled back.
Add a task to run after the current transaction has rolled back.
- Value Params
- task
the
Runnable
task to run after transaction rollback
- Throws
- IllegalStateException
if called from outside a transaction
Atomic block that takes a Runnable
.
Atomic block that takes a Runnable
.
- Value Params
- runnable
the
Runnable
to run within a transaction
Atomic block that takes a Callable
.
Atomic block that takes a Callable
.
- Value Params
- callable
the
Callable
to run within a transaction
- Returns
the value returned by the
Callable
Transform the value stored by ref
by applying the function f
and
return the old value.
Transform the value stored by ref
by applying the function f
and
return the old value.
- Value Params
- f
the function to be applied
- ref
the
Ref.View
to be transformed
- Returns
the old value of
ref
Increment the java.lang.Integer
value of a Ref.View
.
Increment the java.lang.Integer
value of a Ref.View
.
- Value Params
- delta
the amount to increment
- ref
the
Ref.View<Integer>
to be incremented
Increment the java.lang.Long
value of a Ref.View
.
Increment the java.lang.Long
value of a Ref.View
.
- Value Params
- delta
the amount to increment
- ref
the
Ref.View<Long>
to be incremented
Create an empty TArray. Return a java.util.List
view of this Array.
Create an empty TArray. Return a java.util.List
view of this Array.
- Value Params
- length
the length of the
TArray.View
to be created
- Returns
a new, empty
TArray.View
wrapped as ajava.util.List
.
Create an empty TMap. Return a java.util.Map
view of this TMap.
Create an empty TMap. Return a java.util.Map
view of this TMap.
- Returns
a new, empty
TMap.View
wrapped as ajava.util.Map
.
Create a Ref with an initial value. Return a Ref.View
, which does not
require implicit transactions.
Create a Ref with an initial value. Return a Ref.View
, which does not
require implicit transactions.
- Value Params
- initialValue
the initial value for the newly created
Ref.View
- Returns
a new
Ref.View
Create an empty TSet. Return a java.util.Set
view of this TSet.
Create an empty TSet. Return a java.util.Set
view of this TSet.
- Returns
a new, empty
TSet.View
wrapped as ajava.util.Set
.
Create a TArray containing length
elements. Return a TArray.View
,
which does not require implicit transactions. See newList for included
java conversion.
Create a TArray containing length
elements. Return a TArray.View
,
which does not require implicit transactions. See newList for included
java conversion.
- Value Params
- length
the length of the
TArray.View
to be created
- Returns
a new
TArray.View
containinglength
elements (initially null)
Create an empty TMap. Return a TMap.View
, which does not require
implicit transactions. See newMap for included java conversion.
Create an empty TMap. Return a TMap.View
, which does not require
implicit transactions. See newMap for included java conversion.
- Returns
a new, empty
TMap.View
Create an empty TSet. Return a TSet.View
, which does not require
implicit transactions. See newSet for included java conversion.
Create an empty TSet. Return a TSet.View
, which does not require
implicit transactions. See newSet for included java conversion.
- Returns
a new, empty
TSet.View
Causes the enclosing transaction to back up and wait until one
of the Ref
s touched by this transaction has changed.
Causes the enclosing transaction to back up and wait until one
of the Ref
s touched by this transaction has changed.
- Throws
- IllegalStateException
if not in a transaction
Like retry
, but limits the total amount of blocking. This method
only returns normally when the timeout has expired.
Like retry
, but limits the total amount of blocking. This method
only returns normally when the timeout has expired.
Transform the value stored by ref
by applying the function f
.
Transform the value stored by ref
by applying the function f
.
- Value Params
- f
the function to be applied
- ref
the
Ref.View
to be transformed