public class TransactionalRecord<R> extends Object implements Transactional<TransactionalRecord.Ref<R>>, Serializable
Provides transactional
access to a Record
. getForRead()
and getForWrite()
return views of the record, that wither restrict or allow updates respectively, and that are invalidated when the reference is closed
.
Modifier and Type | Class and Description |
---|---|
static class |
TransactionalRecord.Ref<R> |
Constructor and Description |
---|
TransactionalRecord(Object owner,
Record<R> record)
Wraps the given record with transactional access.
|
TransactionalRecord(Record<R> record)
Wraps the given record with transactional access.
|
Modifier and Type | Method and Description |
---|---|
TransactionalRecord.Ref<R> |
getForRead()
Returns a reference for reading.
|
TransactionalRecord.Ref<R> |
getForWrite()
Returns a reference for writing.
|
public TransactionalRecord(Object owner, Record<R> record)
Wraps the given record with transactional access.
owner
- an optional reference to the object that owns the recordrecord
- the recordpublic TransactionalRecord.Ref<R> getForRead()
Transactional
Returns a reference for reading.
getForRead
in interface Transactional<TransactionalRecord.Ref<R>>
public TransactionalRecord.Ref<R> getForWrite()
Transactional
Returns a reference for writing.
getForWrite
in interface Transactional<TransactionalRecord.Ref<R>>