|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.captp.jcomm.SturdyRef
Safe: An object reference that can be checkpointed and/or externalized and which can survive network partitions.
Field Summary | |
private long |
myExpiration
How long is the object obligated to stay around? |
private String |
myHostID
the Vat in which mySwissNum is bound to something |
private LocatorUnum |
myLocatorUnum
The LocatorUnum that links us to the outside world. |
private ConstList |
mySearchPath
Hints about how our vat might be located. |
private BigInteger |
mySwissNum
Bound to an object in the vat identified by myHostID |
(package private) static long |
serialVersionUID
|
Fields inherited from interface org.erights.e.elib.serial.Persistent |
HONORARY, HONORED_NAMES |
Fields inherited from interface org.erights.e.elib.serial.PassByConstruction |
HONORARY, HONORED_NAMES |
Constructor Summary | |
(package private) |
SturdyRef(LocatorUnum locatorUnum,
ConstList searchPath,
String hostID,
BigInteger swissNum,
long expiration)
Package scope constructor for a new SturdyRef. |
Method Summary | |
void |
__printOn(TextWriter out)
Enabled: |
double |
compareTo(SturdyRef other)
Enabled: Test if this SturdyRef and another designate the same object. |
boolean |
equals(Object obj)
Suppressed: Test if this SturdyRef and another are fully equivalent SturdyRefs. |
(package private) String |
exportRef()
Package scope method to produce a URI string for this SturdyRef. |
Object |
getRcvr()
Enabled: Return a (live) reference to the object which this SturdyRef designates. |
Object |
getRcvr(long pollMillis,
long timeout)
Enabled: Like getRcvr() but doesn't resolve the result until we connect
to the object's hosting vat. |
int |
hashCode()
Suppressed: Return a hashcode for this SturdyRef. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static final long serialVersionUID
private final LocatorUnum myLocatorUnum
private final ConstList mySearchPath
private final String myHostID
private final BigInteger mySwissNum
private final long myExpiration
Constructor Detail |
SturdyRef(LocatorUnum locatorUnum, ConstList searchPath, String hostID, BigInteger swissNum, long expiration) throws MalformedURLException
locatorUnum
- The LocatorUnum which maintains the new ref's
registration, and which gives the SturdyRef the
authority to obtain the live object. This component
serialized specially, so that only those that had
a LocatorUnum when they were serialized can obtain
a new one when unserialized.searchPath
- Hints about how to find the new ref's home vatswissNum
- Swiss number of the object that the new ref designatesMethod Detail |
public double compareTo(SturdyRef other)
In the E language,
x <=> yis syntactic sugar for approximately
x.compareTo(y) == 0.0Note that we could have provided a full order for the other cases, but since SturdyRefs are supposed to hold their cryptographic bits opaqely, for all non-same cases we always return NaN (incomparable).
other
- SturdyRef against which we are to be tested for equality
public boolean equals(Object obj)
If you wish to test instead whether they designate the same object
by virtue of the comparing VatID and SwissNumbers, but not comparing
incidentals like searchPath or expiration, then use
"<=>"
.
equals
in class Object
obj
- SturdyRef against which we are to be tested for equality
Object.hashCode()
,
java.util.Hashtable
public int hashCode()
hashCode
in class Object
java.lang.Object#equals(java.lang.Object)
,
java.util.Hashtable
String exportRef() throws MalformedURLException
MalformedURLException
public Object getRcvr() throws IOException
The result may be either a direct or eventual reference. If we cannot currently connect to the object's hosting vat, then the result will resolve to broken.
getRcvr only works when we're onTheAir
.
IOException
public Object getRcvr(long pollMillis, long timeout) throws IOException
getRcvr()
but doesn't resolve the result until we connect
to the object's hosting vat.
Note that the result may still resolve to broken, if the object's hosting vat, for example, no longer has this object registered for lookup by this SturdyRef (no longer has an entry for this SturdyRef's SwissNumber).
getRcvr only works when we're onTheAir
.
pollMillis
- A polling interval hint. Until we have VLS rendezvous
support, the best we can do is poll the attempt to
connect to the hosting vat. pollMillis says how
often we should do so, and thereby tradeoff CPU/comm
against promptness. Once we have VLS rendezvous support,
then we will post a long-lived query with the relevant
VLSs, and refresh this query at a frequency determined by
those VLSs, not by our client. This refreshing is also
a polling loop, but can be long without impeding the
responsiveness of getting connected.timeout
- The time in absMillis (since the epoch) at which we
should give up trying to connect. Once the time has
passed, we should resolve the result to broken rather
than continuing to poll or refresh. A value of -1 means
to keep trying forever.
IOException
public void __printOn(TextWriter out) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |