|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.captp.jcomm.IdentityMgr
Untamed: An instance of the object is accessible in the privileged scope under the name "identityMgr".
It represents both more and less authority than the
makeSturdyRef
function.
It has more authority in that it allows a form of conversion between
capabilities and bits -- specifically SwissBases -- and can therefore not be
given to objects you wish to confine in a
distributed confinement box.
It allows less authority, in that by itself it cannot cause an object to survive a checkpoint/revive cycle. However, by making the SwissBases available, it allows its clients to manually revive such objects.
An IdentityMgr 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 IdentityMgr will likely revive holding instead an appropriate substitute IdentityMgr.
Field Summary | |
private Introducer |
myIntroducer
|
private Timer |
myTimer
|
Constructor Summary | |
(package private) |
IdentityMgr(Introducer introducer,
Timer timer)
|
Method Summary | |
void |
__printOn(TextWriter out)
Enabled: |
void |
addFaultHandler(OneArgFunc swissDB)
Enabled: |
Object[] |
makeKnown(Object obj)
Enabled: optExpirationDate defaults to forever |
Object[] |
makeKnown(Object obj,
long optExpirationDate)
Enabled: Produce a SturdyRef, and a swissBase so in a later incarnation of this vat a newly created object can be made to be the reincarnation of this one (from the perspective of those holding the SturdyRef). |
Object[] |
makeKnownAs(Object obj,
BigInteger swissBase)
Enabled: optExpirationDate defaults to forever |
Object[] |
makeKnownAs(Object obj,
BigInteger swissBase,
long optExpirationDate)
Enabled: Cause 'obj' to be the object designated by 'swissHash cryptoHash()' in this vat. |
SturdyRef |
makeSturdyRef(Object obj,
BigInteger swissBase,
long optExpirationDate)
Enabled: Given an obj-swissNum association, make a SturdyRef that designates this object across space (between vats, even after partitions) and possibly across time (checkpoint/revives). |
BigInteger |
nextSwiss()
Enabled: Returns an unguessable random number suitable for use as a swissBase. |
BigInteger |
registerNewSwiss(Object obj,
BigInteger swissBase)
Enabled: Just delegates to SwissTable.registerNewSwiss(java.lang.Object, java.math.BigInteger) |
void |
removeFaultHandler(OneArgFunc swissDB)
Enabled: |
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
Constructor Detail |
IdentityMgr(Introducer introducer, Timer timer)
introducer
- timer
- Method Detail |
public BigInteger nextSwiss()
public BigInteger registerNewSwiss(Object obj, BigInteger swissBase)
SwissTable.registerNewSwiss(java.lang.Object, java.math.BigInteger)
obj
- swissBase
-
public SturdyRef makeSturdyRef(Object obj, BigInteger swissBase, long optExpirationDate) throws MalformedURLException
This method doesn't itself arrange for the object to be retained. That's
up to its callers. They must arrange for the object to last until the
expiration time, so that the weak association in the SwissTable will
last till then as well.
If the object is to survive this incarnation, its caller must arrange
to revive or reconstruct the object itself, and then to call
makeKnownAs(java.lang.Object, java.math.BigInteger)
to re-establish the association between the
object and its swissNumber. The CapTP package does not provide such
functionality itself. But
org.erights.e.extern.persist.SturdyRefMaker
builds this
functionality on top of the API listed here.
obj
- The object for which a SturdyRef is desiredswissBase
- The hash of which will be the swissNum associated with
this object.optExpirationDate
- The date after which the SturdyRef will not
longer be guaranteed to be valid. If
Long.MAX_VALUE, then it's always valid.
MalformedURLException
public Object[] makeKnown(Object obj) throws MalformedURLException
MalformedURLException
public Object[] makeKnown(Object obj, long optExpirationDate) throws MalformedURLException
An object is that which object references to it designate. From one vat incarnation to another, the only intervat references which survive are SturdyRefs. When doing identity-persistence (as opposed to object persistence), the application creates the first SturdyRef to a persistent object using makeKnown(..), and makes sure to store the swissBase somewhere for use during this vat's next incarnation. (In identity-persistence, where this precious information is stored is up to the app.)
On the next incarnation of the vat, the app creates a fresh object to serve as the reincarnation of the original object, and calls makeKnownAs(..) so the old SturdyRef will now designate the new object.
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.
org.erights.e.extern.timer.Timeout
for cancelling this
sturdiness of the object. Though, once a SturdyRef has been given
out promising a given expirationDate, it's considered rude to cancel
it without coordinating with those other parties.
Note that if an object is sturdified multiple times, cancelling
a registration only cancels that one registration, leaving the
others intact.
MalformedURLException
public Object[] makeKnownAs(Object obj, BigInteger swissBase) throws MalformedURLException
MalformedURLException
public Object[] makeKnownAs(Object obj, BigInteger swissBase, long optExpirationDate) throws MalformedURLException
Used by an identity-persistent app (as opposed to an object-persistent app) to cause old SturdyRefs that were given out by a previous incarnation of this vat to continue to function. It's polite for an identity-peristent app to use an expiration date that's at least as big as the ones used in previous incarnations. To do otherwise is to not honor the previously implied obligation.
makeKnown(Object, long)
.
MalformedURLException
public void addFaultHandler(OneArgFunc swissDB)
swissDB
- SwissTable.addFaultHandler(org.erights.e.elib.util.OneArgFunc)
public void removeFaultHandler(OneArgFunc swissDB)
swissDB
- SwissTable.removeFaultHandler(org.erights.e.elib.util.OneArgFunc)
public void __printOn(TextWriter out) throws IOException
IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |