Package org.mozilla.javascript

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


      Scriptable log = context.newObject(scope, "Log", args);
      ((JSLog)log).setLogger(getLogger());
      scope.put("log", scope, log);

    } catch (Exception e) {
      context.exit();
      System.out.println("problem initializing JavaScriptInterpreter: ");
      e.printStackTrace();
      throw e;
    }
  }
View Full Code Here


    Object args[] = { jswk };
    try {
      ((Function)handleContFunction).call(context, kScope, kScope, args);
    }
    finally {
      context.exit();
    }
  }

  public void processPipeline(String name, Map pipelineArgs, Object bizData,
                              WebContinuation continuation,
View Full Code Here

      final Object wrappedFactory = Context.javaToJS(new DatasourceFactory(), scope);
      ScriptableObject.putProperty(scope, "datasourceFactory", wrappedFactory);
    }
    finally
    {
      context.exit();
    }
  }

  public void setScope(final Scriptable scope)
  {
View Full Code Here

            Function fun = (Function) v;
            Context cx = RhinoScriptEngine.enterContext();
            try {
                v = fun.call(cx, fun.getParentScope(), this, args);
            } finally {
                cx.exit();
            }
            if (v != null) {
                if (!(v instanceof Scriptable)) {
                    return v;
                }
View Full Code Here

      } catch (ScriptException e) {
    throw new ParseException
        ("Problem evaluating duration value \""
         + getCondition() + "\": " + e.getMessage(), 0);
      } finally {
    cx.exit();
      }
  }
  Date end = null;
  if (cond instanceof Date) {
      end = (Date)cond;
View Full Code Here

                    logger.error("Problem evaluating transition condition \""
               + trans.condition() + "\": " + e.getMessage());
                }
    return false;
      } finally {
    cx.exit();
      }
  }
    }

    /**
 
View Full Code Here

    context.evaluateString(
        scope, nodeMapperJavaScript, "nodemapper.js", 1, null);
    urlToGraphNodeFunction = (Function) scope.get("URLToGraphNode", scope);
    urlFromGraphNodeFunction = (Function) scope.get("URLFromGraphNode", scope);
    context.exit();
  }

  /**
   * Returns an sgn:// URL, if possible, for the given url,
   * else returns the provided URL back.
View Full Code Here

    Context context = Context.enter();
    Object functionArgs[] = { url };
    Object objResult = urlToGraphNodeFunction.call(
        context, scope, scope, functionArgs);
    String result = Context.toString(objResult);
    context.exit();
    return result;
  }

  /**
   * Returns an URL, if possible, for the provided sgn URL and URL
View Full Code Here

    Context context = Context.enter();
    Object functionArgs[] = { sgnUrl, urlType };
    Object objResult = urlFromGraphNodeFunction.call(
        context, scope, scope, functionArgs);
    String result = Context.toString(objResult);
    context.exit();
    if (result != null && result.length() == 0) {
      return null;
    }
    return result;
  }
View Full Code Here

                throw new org.mozilla.javascript.WrappedException(e);
            }
        }
        finally
        {
            if (newThread) cx.exit(); // Liberamos el thread
        }
    }

    public Object evaluateString(Scriptable scope,String code)
    {
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.