class SnapshotRep extends Object implements Entry
snapshot
implementation of the
proxy to create a snapshot
. Here's what the JavaSpaces
specification says about snapshot
.
The process of serializing an entry for transmission to a JavaSpaces
service will be identical if the same entry is used twice. This is most
likely to be an issue with templates that are used repeatedly to search
for entries with read
or take
. The client-side
implementations of read
and take
cannot
reasonably avoid this duplicated effort, since they have no efficient
way of checking whether the same template is being used without
intervening modification.
The snapshot
method gives the JavaSpaces service implementor
a way to reduce the impact of repeated use of the same entry. Invoking
snapshot
with an Entry
will return another
Entry
object that contains a snapshot of the
original entry. Using the returned snapshot entry is equivalent to
using the unmodified original entry in all operations on the same
JavaSpaces service. Modifications to the original entry will not
affect the snapshot. You can snapshot
a null
template; snapshot
may or may not return null given a
null
template.
The entry returned from snapshot
will be guaranteed
equivalent to the original unmodified object only when used with
the space. Using the snapshot with any other JavaSpaces service
will generate an IllegalArgumentException
unless the
other space can use it because of knowledge about the JavaSpaces
service that generated the snapshot. The snapshot will be a different
object from the original, may or may not have the same hash code,
and equals
may or may not return true
when invoked with the original object, even if the original
object is unmodified.
A snapshot is guaranteed to work only within the virtual machine
in which it was generated. If a snapshot is passed to another
virtual machine (for example, in a parameter of an RMI call),
using it--even with the same JavaSpaces service--may generate
an IllegalArgumentException
.
For more information, please review the appropriate specifications.Modifier and Type | Field and Description |
---|---|
private EntryRep |
rep |
(package private) static long |
serialVersionUID |
Constructor and Description |
---|
SnapshotRep(Entry e)
Create a new
SnapshotRep that is a snapshot of
e . |
SnapshotRep(EntryRep e)
Construct an SnapshotRep from an existing EntryRep
|
static final long serialVersionUID
private EntryRep rep
SnapshotRep(Entry e) throws MarshalException
SnapshotRep
that is a snapshot of
e
.MarshalException
SnapshotRep(EntryRep e)
EntryRep rep()
EntryRep
.Copyright 2007-2013, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.