From: Nicolas Bielza <nicolas.bielza@al...> - 2004-06-29 19:49:51
I'm trying to use BeanShell to "customize" my application in the
The application invokes a beanshell script that creates a new "task" (a
Runnable). The task is then passed into the application context, and is
serialized and saved for later use.
When I serialize the scripted task, I don't want the whole script
context to be serialized (especially because some of the objects in the
script are not serializable). So I tried to prune it as described in the
documentation (section "Serializing Interpreters and Scripted Objects").
When I prune from beanshell ( task.namespace.prune(); ), I get :
Cannot access field: namespace, on object: 'this' reference (XThis) to
Bsh object: NameSpace: anonymous block object (bsh.NameSpace@...)
I can't figure out what this means..
So, I tried to prune from java: I'm trying to cast the object into a
bsh.This so I can .getNameSpace().prune() it, but it appears that the
actual type is $proxy0 ???
Did anyone succeed in doing something similar ? Should I forget about
serializing scripted objects ?
[ I'm using Java 1.4.2 with beanshell versions 1.3.0 and 2.0b1 with same
Get latest updates about Open Source Projects, Conferences and News.