Subj : Re: ClassShutter is never asked To : superilu From : Igor Bukanov Date : Tue Feb 01 2005 04:14 pm Andre Seidelt wrote: > I tried to disable the Java access for Rhino 1.6r1. > The following code does not work: .... > > public static void main(String[] args) { ************************************ > Context ctx = new Context(); > Context.enter(); ************************************ > ctx.setClassShutter(new MyShutter()); > try { > Scriptable scope = ctx.initStandardObjects(); > Object wrappedOut = Context.javaToJS(System.out, scope); > ScriptableObject.putProperty(scope, "out", wrappedOut); > Object result = ctx.evaluateString(scope, s, "", 0, null); > System.out.println(result); > } finally { > Context.exit(); > } > } > } The lines marked with **** should be: Context ctx = Context.enter(); ClassShutter is extracted from the Context instance associated with the current thread using Context.enter and ctx holds unrelated reference. Regards, Igor .