Ejemplo n.º 1
0
 public static void clearInterval(
     final Context cx, final Scriptable thisObj, Object[] args, Function funObj)
     throws ScriptException {
   JaggeryContext context = CommonManager.getJaggeryContext();
   ServletContext servletContext = (ServletContext) context.getProperty(Constants.SERVLET_CONTEXT);
   String contextPath = servletContext.getContextPath();
   RhinoTopLevel.clearTimeout(cx, thisObj, args, funObj);
   List<String> taskIds = intervals.get(contextPath);
   taskIds.remove(String.valueOf(args[0]));
 }
Ejemplo n.º 2
0
 private static String resolveScriptPath(List<String> parts, Map<String, Object> map) {
   String part = parts.remove(0);
   if (parts.isEmpty()) {
     return getPath(map, part);
   }
   Object obj = map.get(part);
   if (obj == null) {
     return getPath(map, "/");
   }
   if (obj instanceof Map) {
     return resolveScriptPath(parts, (Map<String, Object>) obj);
   }
   return null;
 }