[e-lang] JOSS PBC works between rune instances, not between local VATs?

Kevin Reid kpreid at mac.com
Tue Jan 30 11:49:03 CST 2007


On Jan 30, 2007, at 11:08, Martin Scheffler wrote:

> I have some Java geometry classes: Quaternion, Vector3D. These classes
> implement JOSSPassByConstruction. I pass objects of these classes
> happily between my client and server, and they arrive as :near.
> Now I tried to create a Vat with makeVat. When I pass a vector to that
> vat, it arrives as a proxy!

> def makeVat := <unsafe:org.erights.e.elib.vat.makeVat>
> def seedVat := <elang:interp.seedVatAuthor>(<unsafe>)
>
> def vat := makeVat.make("headless", "testvat")
> def	scriptObj:= seedVat(vat, scriptSource)

This is because seedVat uses, by default, the boot-comm system, which  
does not do general PassByConstruction, but only special cases  
sufficient to bootstrap communication between local vats (the objects  
must be DeepPassByCopy and thread-safe).

To start proper communication, use the 'virtualized' seedVat, which  
uses boot-comm to set up CapTP communication.

   introducer.onTheAir()
   def virtualSeedVat := seedVat.virtualize(introducer)

(MarkM has said he will fix the confusing naming: http://www.eros- 
os.org/pipermail/e-lang/2007-January/011776.html .)

(If you're using persistence, perform the virtualize only after you  
have restored the persistent vat identity.)


Notes unrelated to getting your code working:

1. It would be simpler to seed and create the vat together:

   def [scriptObj, vat] := virtualSeedVat(scriptSource)

2. I would think that now that we have uncall-based PBC, JOSS PBC  
should not be used by new code. However, I don't see a way for  
arbitrary Java classes to claim to be approved by the  
PassByConstructionAuditor. MarkM?

-- 
Kevin Reid                            <http://homepage.mac.com/kpreid/>




More information about the e-lang mailing list