Examples of Script


Examples of org.mozilla.javascript.Script

            for (int i = 0, size = execList.size(); i < size; i++) {
                String sourceURI = (String)execList.get(i);
                ScriptSourceEntry entry =
                    (ScriptSourceEntry)compiledScripts.get(sourceURI);
                long lastMod = entry.getSource().getLastModified();
                Script script = entry.getScript(context, this.scope, false);
                if (lastExecTime == 0 || lastMod > lastExecTime) {
                    script.exec(context, thrScope);
                }
            }
        }
        return thrScope;
    }
View Full Code Here

Examples of org.mozilla.javascript.Script

            throw new ResourceNotFoundException(fileName + ": not found");
        }
        synchronized (compiledScripts) {
            ScriptSourceEntry entry =
                (ScriptSourceEntry)compiledScripts.get(src.getURI());
            Script compiledScript = null;
            if (entry == null) {
                compiledScripts.put(src.getURI(),
                                    entry = new ScriptSourceEntry(src));
            }
            compiledScript = entry.getScript(cx, this.scope, false);
View Full Code Here

Examples of org.mozilla.javascript.Script

        InputStream is = src.getInputStream();
        if (is == null) {
            throw new ResourceNotFoundException(src.getURI() + ": not found");
        }
        Reader reader = new BufferedReader(new InputStreamReader(is));
        Script compiledScript = cx.compileReader(scope, reader,
                                                 src.getURI(),
                                                 1, null);
        return compiledScript;
    }
View Full Code Here

Examples of org.openfaces.util.Script

            options = createFormatOptions(context, slider);
        } catch (JSONException e) {
            throw new FacesException(e);
        }

        Script initScript = new ScriptBuilder().initScript(context, slider, "O$.Slider._init",
                slider.getValue(), slider.getMinValue(), slider.getMaxValue(),
                slider.getMinorTickSpacing(), slider.getMajorTickSpacing(),
                slider.getOrientation(), slider.getFillDirection(),
                slider.isDisabled(), slider.isTooltipEnabled(),
                slider.isBarCanChangeValue(), slider.isBarVisible(),
View Full Code Here

Examples of org.openhab.core.scriptengine.Script

  public static void handleScript(String[] args, Console console) {
    ScriptEngine scriptEngine = ConsoleActivator.scriptEngineTracker.getService();
    if(scriptEngine!=null) {
      String scriptString = Joiner.on(" ").join(args);
      Script script;
      try {
        script = scriptEngine.newScriptFromString(scriptString);
        Object result = script.execute();
       
        if(result!=null) {
          console.println(result.toString());
        } else {
          console.println("OK");
View Full Code Here

Examples of org.owasp.webscarab.plugin.Script

    private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
        TreePath path = _hookTree.getTree().getSelectionPath();
        if (path.getPathCount()==4) {
            String plugin = (String) path.getPathComponent(1);
            Hook hook = (Hook) path.getPathComponent(2);
            Script script = (Script) path.getPathComponent(3);
            _manager.removeScript(plugin, hook, script);
        }
    }//GEN-LAST:event_removeButtonActionPerformed
View Full Code Here

Examples of org.rsbot.script.Script

      public void actionPerformed(final ActionEvent evt) {
        final ScriptDefinition def = model.getDefinition(table.getSelectedRow());
        setVisible(false);
        bot.getScriptHandler().removeScriptListener(ScriptSelector.this);
        dispose();
        Script script = null;
        try {
          script = def.source.load(def);
        } catch (final Exception e) {
          log.severe(e.getMessage());
        }
View Full Code Here

Examples of org.rzo.yajsw.script.Script

  {
    if (clusterScript != null && !"".equals(clusterScript))
    {
      List args = _config.getList("wrapper.windows.cluster.script.args", new ArrayList());
      int timeout = _config.getInt("wrapper.windows.cluster.script.timeout", 0);
      final Script script = ScriptFactory.createScript(clusterScript, "", this, args, getWrapperLogger(), timeout);
      if (script == null)
        return;
      try
      {
        Class clazz = this.getClass().getClassLoader().loadClass("org.rzo.yajsw.os.ms.win.w32.Cluster");
        _cluster = clazz.newInstance();
        _clusterListener = new ClusterNodeChangeListener()
        {
          public void nodeChanged()
          {
            script.execute();
          }
        };
        Method m = clazz.getMethod("addNodeChangeListener", ClusterNodeChangeListener.class);
        m.invoke(_cluster, _clusterListener);
      }
View Full Code Here

Examples of org.rzo.yajsw.script.Script

        String value = _config.getString(key);
        List args = _config.getList(key + ".args", new ArrayList());
        int timeout = _config.getInt(key + ".timeout", 0);

        String state = key.substring(key.lastIndexOf(".") + 1);
        final Script script = ScriptFactory.createScript(value, state, this, args, getWrapperLogger(), timeout);
        int iState = toIntState(state);
        if (iState >= 0 && script != null)
          addStateChangeListener(iState, new StateChangeListener()
          {

            public void stateChange(int newState, int oldState)
            {
              script.executeWithTimeout();
            }

          });
      }
    }
View Full Code Here

Examples of org.rzo.yajsw.script.Script

   *
   * @return the trigger script
   */
  private Object getTriggerScript(String script, String key, String[] args, int timeout)
  {
    final Script s = ScriptFactory.createScript(script, key, this, args, getWrapperLogger(), timeout);
    if (s == null)
    {
      this.getWrapperLogger().info("error initializing script " + script);
      return null;
    }
    this.getWrapperLogger().info("found script " + s.getScript());
    // final String id = key;

    return new TriggerAction()
    {
      public Object execute(final String line)
      {
        scriptExecutor.execute(new Runnable()
        {

          public void run()
          {
            AbstractWrappedProcess.this.getWrapperLogger().info("start script " + s.getScript());
            s.executeWithTimeout(new String(line));
            AbstractWrappedProcess.this.getWrapperLogger().info("end script " + s.getScript());
          }
        });
        return null;
      }
    };
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.