Re: Caching and re-using bindings

2016-12-08 Thread Edmond Kemokai
Not a problem at all, happy to help!! Also feel free to further explore HiveMind and share with other devs, it is a very innovative platform for using Java scripting engines to build webs. On Dec 8, 2016 9:18 AM, "yikes aroni" wrote: thanks Edmond --- VERY MUCH FOR YOUR TIME!!! So i see wh

Re: Caching and re-using bindings

2016-12-06 Thread Edmond Kemokai
I doubt there is a problem, you're probably making a minor error. I am the developer of HiveMind, it is a web app platform that relies entirely on scripting engines. It doesn't cache bindings but rather caches the engine and creates a new binding to handle every request. You can access a demo inst

Re: Caching and re-using bindings

2016-12-06 Thread yikes aroni
Hmm it works if i instantiate the SimpleBinding obj and then putAll the bindings from the original bindings obj. Bindings bSimple = new SimpleBindings(); bSimple.putAll(bEngine); Otherwise they either remain the same object or are bound in some way s.t. changes to bEngine are in bSimple. This

Re: Caching and re-using bindings

2016-12-06 Thread yikes aroni
Thanks for your response Edmond -- the problem is that a simplebindings object still gets all the changes to the original bindings see below: // put variable globalA into the ScriptContext.ENGINE_SCOPE bindings se.eval("globalA = 'testA';"); // Snapshot the bindings from the engine. Bindings b

Re: Caching and re-using bindings

2016-12-05 Thread Edmond Kemokai
Why don't you create instances of SimpleBinding and use those as needed? Use ScriptEngine.setBindings to reset the binding... On Dec 5, 2016 1:36 PM, "yikes aroni" wrote: > I want to cache ScriptEngine bindings for reuse. The basic algo would be > > 1) Build up my ScriptEngine (SE) with stuff i

Caching and re-using bindings

2016-12-05 Thread yikes aroni
I want to cache ScriptEngine bindings for reuse. The basic algo would be 1) Build up my ScriptEngine (SE) with stuff i need. 2) Snapshot the bindings -- i.e., cache them Use engine.getBindings(ScriptContext.ENGINE_SCOPE) 3) Use the SE for stuff that might modify its state. 4) When done, replace th