ContextAction initAction = new ContextAction() {
public Object run(Context cx) {
Scriptable scriptable = cx.initStandardObjects(null, false);
defineGlobalWrapperClass(scriptable);
globalObject = createGlobalObject(cx);
ClassCache cache = ClassCache.get(globalObject);
cache.setCachingEnabled(rhinoClassLoader != null);
// import Java lang package & DOM Level 3 & SVG DOM packages
StringBuffer sb = new StringBuffer("importPackage(Packages.");
for (int i = 0; i < TO_BE_IMPORTED.length - 1; i++) {
sb.append(TO_BE_IMPORTED[i]);
sb.append(");importPackage(Packages.");