public interface ISnapshotProvider extends IReferenceCountable
Snapshot providers support IReferenceCountable
protocol, although
some implementations do not have a need in reference counting and inherit
a no-op implementation of the protocol methods in this interface. When it
is known that a snapshot provider does not actually use reference counting,
clients do not need to follow the requirements set forth in that protocol.
Snapshot providers are generally designed to be safe for use by multiple threads. Each implementation is expected to clearly document thread-safety guarantees it provides.
Modifier and Type | Method and Description |
---|---|
default void |
addRef()
Spawns a new independent ownership of this object.
|
ISnapshot |
getSnapshot()
Returns the current snapshot of the underlying resource or buffer.
|
default void |
release()
Relinquishes an independent ownership of this object.
|
close
ISnapshot getSnapshot()
Note that it is possible to obtain a non-expiring
snapshot from the provider, although protractedly holding on non-expiring
snapshots is not recommended as they may potentially consume large amount
of space.
null
)java.lang.IllegalStateException
- if no snapshot can be taken at this timedefault void addRef()
IReferenceCountable
addRef()
must ultimately be
followed by exactly one call to IReferenceCountable.release()
.addRef
in interface IReferenceCountable
default void release()
IReferenceCountable
release
in interface IReferenceCountable
IReferenceCountable.close()
Copyright (c) 2014, 2018 1C-Soft LLC and others. Made available under the Eclipse Public License 2.0