Class RoErasedAccess
java.lang.Object
com.exonum.binding.core.proxy.AbstractNativeProxy
com.exonum.binding.core.storage.database.AbstractAccess
com.exonum.binding.core.storage.database.RoErasedAccess
- All Implemented Interfaces:
Access
public final class RoErasedAccess extends AbstractAccess
A readonly, "erased", database Access object.
This class primarily exists to support readonly forks and snapshots, but also supports other readonly accesses.
Readonly Forks
A readonly Fork sees all the changes made to the base Fork, but forbids modifications. That allows safely passing the readonly fork to foreign code.
A readonly fork forbids accessing the same index that is being modified in the base fork. Also, accessing an index in the readonly fork will make it inaccessible in the base fork.
-
Field Summary
-
Method Summary
Modifier and Type Method Description static RoErasedAccess
fromHandle(long nativeHandle, Cleaner cleaner)
Creates a new erased readonly access from the native handle.Cleaner
getCleaner()
Returns the cleaner of this access.Methods inherited from class com.exonum.binding.core.storage.database.AbstractAccess
canModify, getAccessNativeHandle, getEntry, getKeySet, getList, getMap, getOpenIndexes, getProofEntry, getProofList, getProofMap, getRawProofMap, getValueSet, nativeCanModify, nativeFree
Methods inherited from class com.exonum.binding.core.proxy.AbstractNativeProxy
getNativeHandle, isValidHandle
-
Method Details
-
fromHandle
Creates a new erased readonly access from the native handle. The destructor will be registered in the given cleaner.- Parameters:
nativeHandle
- a handle of the native readonly ErasedAccess objectcleaner
- a cleaner to destroy the native peer and any dependent objects
-
getCleaner
Description copied from class:AbstractAccess
Returns the cleaner of this access. It is supposed to be used with collections and other objects depending on this access.- Specified by:
getCleaner
in classAbstractAccess
-