com.sun.jini.outrigger
Class SnapshotRep

java.lang.Object
  extended by com.sun.jini.outrigger.SnapshotRep
All Implemented Interfaces:
Serializable, Entry

 class SnapshotRep
extends Object
implements Entry

This class is used by the 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.

Author:
Sun Microsystems, Inc.

Field Summary
private  EntryRep rep
           
(package private) static long serialVersionUID
           
 
Constructor Summary
SnapshotRep(Entry e)
          Create a new SnapshotRep that is a snapshot of e.
SnapshotRep(EntryRep e)
          Construct an SnapshotRep from an existing EntryRep
 
Method Summary
(package private)  EntryRep rep()
          Return the pre-computed EntryRep.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

rep

private EntryRep rep
Constructor Detail

SnapshotRep

SnapshotRep(Entry e)
      throws MarshalException
Create a new SnapshotRep that is a snapshot of e.

Throws:
MarshalException

SnapshotRep

SnapshotRep(EntryRep e)
Construct an SnapshotRep from an existing EntryRep

Method Detail

rep

EntryRep rep()
Return the pre-computed EntryRep.



Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.