Examples of initStandardObjects()


Examples of org.mozilla.javascript.Context.initStandardObjects()

    private final Scriptable scope;

    JavaScriptE4XXmlBeansHelper(ScriptEngine engine) {
        Context cx = Context.enter();
        try {
            this.scope = cx.initStandardObjects();
        } finally {
            Context.exit();
        }
    }
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

        }

        Context cx = Context.enter();
        try {

            this.scope = cx.initStandardObjects();

        } finally {
            Context.exit();
        }
    }
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

            logger.debug("entering script context");
            Context ctx = Context.enter();
            logger.trace("ctx: " + ctx);
           
            logger.debug("initializing standard objects");
            Scriptable scope = ctx.initStandardObjects();
            logger.debug("scope: " + scope);
           
            logger.debug("setting script bindings");
            for(String key : pairs.keySet())
            {
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

//        ScriptEngineManager manager = new ScriptEngineManager();
//        engine = manager.getEngineByExtension("js");
//        xmlHelper = XMLHelper.getArgHelper(engine);
        Context cx = Context.enter();
        try {
            ContextHelper.setTopCallScope(cx, cx.initStandardObjects());
        } finally {
            Context.exit();
        }
    }
}
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

    public static Scriptable getRootScope() {
        if (_rootScope == null) {
            // Create it if never used up to now
            Context ctx = Context.enter();
            try {
                _rootScope = ctx.initStandardObjects(null);
            } finally {
                Context.exit();
            }
        }
        return _rootScope;
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

        }
        // entering a context
        Context ctx = enterContext();
        try {
            try {
                Scriptable scriptable = ctx.initStandardObjects(null, false);
                ScriptableObject.defineClass(scriptable, WindowWrapper.class);
            } catch (Exception e) {
                // cannot happen
            }
            // we now have the window object as the global object from the
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

    String resultStr = "";

    Context cx = Context.enter();
    try {

      Scriptable scope = cx.initStandardObjects(null);
     
      // Set up some objects for the script to play with
      scope.put("ctx", scope, jmctx); //$NON-NLS-1$
      scope.put("vars", scope, vars); //$NON-NLS-1$
      scope.put("props", scope, JMeterUtils.getJMeterProperties()); //$NON-NLS-1$
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

        String scriptStr = sb.toString();

        Context cx = ContextFactory.getGlobal().enterContext();
        boolean providerFound = false;
        try {
            Scriptable scriptScope = cx.initStandardObjects(null, true);
            Object[] ids = compileScript(cx, scriptStr, scriptScope, f);
            if (ids.length > 0) {
                Service.Mode mode = Service.Mode.PAYLOAD;
                for (Object idObj : ids) {
                    if (!(idObj instanceof String)) {
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

     *                if an error occurs
     */
    public void init(ServletConfig servletConfig) throws ServletException {
        try {
            Context cx = Context.enter();
            Scriptable scope = cx.initStandardObjects(null);
            ServletContext servletContext = servletConfig.getServletContext();
            ((ScriptableObject)scope).defineProperty
              ("servletContext", servletContext,
               ScriptableObject.PERMANENT | ScriptableObject.READONLY);
            InputStream is
View Full Code Here

Examples of org.mozilla.javascript.Context.initStandardObjects()

                    MessageContext.getCurrentMessageContext().getConfigurationContext();
            cx.putThreadLocal(MashupConstants.AXIS2_CONFIGURATION_CONTEXT, configurationContext);
            AxisService service = new AxisService();
            service.addParameter(MashupConstants.MASHUP_AUTHOR, CurrentSession.getUser());
            cx.putThreadLocal(MashupConstants.AXIS2_SERVICE, service);
            Scriptable scope = cx.initStandardObjects();
            ScriptableObject.defineClass(scope, ResourceHostObject.class);
            ScriptableObject.defineClass(scope, CollectionHostObject.class);
            ScriptableObject.defineClass(scope, RegistryHostObject.class);
            Object result = cx.evaluateString(scope, script, "<cmd>", 1, null);
            if (result != null && log.isInfoEnabled()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.