|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.erights.e.extern.persist.SturdyRefMaker
Untamed: Enables one to make SturdyRefs for objects, even if one is in a distributed confinement box.
An instance of the object is accessible in the privileged scope under the name "makeSturdyRef".
An SturdyRefMaker isn't itself Persistent, but the relevant instance is expected to be a scalpel-key, so a persistent object holding a persistent pointer to that SturdyRefMaker will likely revive holding instead an appropriate substitute SturdyRefMaker.
Field Summary | |
private IdentityMgr |
myIdentityMgr
|
private Introducer |
myIntroducer
|
private FlexMap |
myOptSwissRetainers
|
private ValueGuard |
myPersistenceGuard
|
private Timer |
myTimer
|
Constructor Summary | |
SturdyRefMaker(Introducer introducer,
Timer timer,
IdentityMgr identityMgr,
ValueGuard persistenceGuard)
Enabled: |
Method Summary | |
void |
__printOn(TextWriter out)
Enabled: |
Object[] |
make(Object obj)
Enabled: optExpirationDate defaults to forever. |
Object[] |
make(Object obj,
long optExpirationDate)
Enabled: Produce a SturdyRef for a persistence-capable object, thereby making it persistent. |
Runnable |
onRevival(Object reactor,
String verb,
Object[] args)
Enabled: Arrange for reactor to eventually be notified as |
SturdyRef |
run(Object obj)
Enabled: Produce a persistent perpetual SturdyRef for an object. |
SturdyRef |
run(Object obj,
long optExpirationDate)
Enabled: Produce a non-cancellable persistent SturdyRef for an object. |
FlexMap |
tearOffRoots(FlexMap optOldRoots)
Enabled: Uses the "tear-off" technique for establishing private shared state between two objects. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private final Introducer myIntroducer
private final Timer myTimer
private final IdentityMgr myIdentityMgr
private final ValueGuard myPersistenceGuard
private FlexMap myOptSwissRetainers
Constructor Detail |
public SturdyRefMaker(Introducer introducer, Timer timer, IdentityMgr identityMgr, ValueGuard persistenceGuard)
introducer
- timer
- identityMgr
- Method Detail |
public FlexMap tearOffRoots(FlexMap optOldRoots)
The "tear-off" tag can only be torn off once, and once it's torn off it's apparent that it is to all those who try to do so.
In this case, the tearing off is supposed to happen by the TimeMachine when it transitions out of the Ephemeral state. Therefore, if a tearOff hasn't happened yet, the code here assumes that we're still in the Ephemeral state and that nothing may be made persistent.
Note: If you want to make something sturdy for purposes of distribution,
but not persistent, use IdentityMgr
instead. This requires the
Introducer to be identified, but is independent of the state of the
TimeMachine.
public SturdyRef run(Object obj) throws MalformedURLException
Just run/2 with the optExpirationDate defaulting to forever.
obj
- The object for which a SturdyRef is desired
MalformedURLException
public SturdyRef run(Object obj, long optExpirationDate) throws MalformedURLException
Equivalent to
make(obj,optExpirationDate)[0].
MalformedURLException
public Object[] make(Object obj) throws MalformedURLException
obj
-
MalformedURLException
public Object[] make(Object obj, long optExpirationDate) throws MalformedURLException
The SturdyRef will designate the object across time and space, at least until the expiration time, so long as the hosting vat (this vat) is accessible.
obj
- The object for which a SturdyRef is desiredoptExpirationDate
- The date after which the SturdyRef will not
longer be guaranteed to be valid. If
Long.MAX_VALUE, then it's always valid.
Runnable
for cancelling this persistent
sturdiness.
MalformedURLException
public Runnable onRevival(Object reactor, String verb, Object[] args) throws MalformedURLException
reactor <- verb(args...)following future revivals.
Once this notification is no longer needed on further revivals, the notification action should use the returned persistent Runnable to cancel them.
reactor
- verb
- args
-
MalformedURLException
public void __printOn(TextWriter out) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |