Examples of ScriptExecutor


Examples of com.alibaba.tamper.process.script.ScriptExecutor

                Map newParam = (Map) custom.get(ContextObjectHolder.SCRIPT_CONTEXT);
                param.putAll(newParam);
            }

            // 进行值转化处理
            ScriptExecutor scriptExecutor = ScriptHelper.getInstance().getScriptExecutor();
            value = scriptExecutor.evaluate(param, currentField.getScript());
        }

        // 继续走到下一步处理
        return invocation.proceed(value);
View Full Code Here

Examples of com.serotonin.m2m2.rt.script.ScriptExecutor

    @DwrPermission(user = true)
    public ProcessResult validateScript(String script, int sourcePointId, int targetPointId) {
        ProcessResult response = new ProcessResult();
        TranslatableMessage message;
        ScriptExecutor scriptExecutor = new ScriptExecutor();

        DataPointRT point = Common.runtimeManager.getDataPoint(sourcePointId);
        if (point == null)
            message = new TranslatableMessage("event.pointLink.sourceUnavailable");
        else {
            Map<String, IDataPointValueSource> context = new HashMap<String, IDataPointValueSource>();
            context.put(PointLinkRT.CONTEXT_VAR_NAME, point);
            int targetDataType = new DataPointDao().getDataPoint(targetPointId).getPointLocator().getDataTypeId();

            try {
                PointValueTime pvt = scriptExecutor.execute(script, context, System.currentTimeMillis(),
                        targetDataType, -1);
                if (pvt.getValue() == null)
                    message = new TranslatableMessage("event.pointLink.nullResult");
                else if (pvt.getTime() == -1)
                    message = new TranslatableMessage("pointLinks.validate.success", pvt.getValue());
View Full Code Here

Examples of com.serotonin.m2m2.rt.script.ScriptExecutor

        }

        int targetDataType = targetPoint.getVO().getPointLocator().getDataTypeId();

        if (!StringUtils.isBlank(vo.getScript())) {
            ScriptExecutor scriptExecutor = new ScriptExecutor();
            Map<String, IDataPointValueSource> context = new HashMap<String, IDataPointValueSource>();
            DataPointRT source = Common.runtimeManager.getDataPoint(vo.getSourcePointId());
            context.put(CONTEXT_VAR_NAME, source);

            try {
                PointValueTime pvt = scriptExecutor.execute(vo.getScript(), context, newValue.getTime(),
                        targetDataType, newValue.getTime());
                if (pvt.getValue() == null) {
                    raiseFailureEvent(newValue.getTime(), new TranslatableMessage("event.pointLink.nullResult"));
                    return;
                }
View Full Code Here

Examples of org.apache.ace.gogo.execute.ScriptExecutor

        String script = System.getProperty("ace.gogo.script");
        if (script != null) {
            long delay = Long.getLong("ace.gogo.script.delay", 300L);

            manager.add(createComponent()
                .setImplementation(new ScriptExecutor(script, delay))
                .setComposition("getInstances")
                .add(createServiceDependency()
                    .setService(CommandProcessor.class)
                    .setRequired(true)));
        }
View Full Code Here

Examples of org.jboss.arquillian.persistence.core.data.script.ScriptExecutor

   private void executeScript(String script)
   {
      try
      {
         new ScriptExecutor(databaseConnection.get().getConnection()).execute(script);
      }
      catch (SQLException e)
      {
         throw new DBUnitConnectionException("Unable to obtain JDBC connection", e);
      }
View Full Code Here

Examples of org.jboss.arquillian.persistence.script.ScriptExecutor

   private void executeScript(String script)
   {
      try
      {
         final StatementSplitter statementSplitter = new StatementSplitterResolver(scriptConfigurationInstance.get()).resolve();
         final ScriptExecutor scriptExecutor = new ScriptExecutor(databaseConnection.get().getConnection(), scriptConfigurationInstance.get(), statementSplitter);
         scriptExecutor.execute(script);
      }
      catch (SQLException e)
      {
         throw new DBUnitConnectionException("Unable to execute script.", e);
      }
View Full Code Here

Examples of org.jboss.arquillian.persistence.script.ScriptExecutor

   private void executeScript(String script)
   {
      try
      {
         final ScriptExecutor scriptExecutor = new ScriptExecutor(databaseConnection.get().getConnection());
         scriptExecutor.setStatementDelimiter(scriptConfigurationInstance.get().getSqlStatementDelimiter());
         scriptExecutor.execute(script);
      }
      catch (SQLException e)
      {
         throw new DBUnitConnectionException("Unable to obtain JDBC connection", e);
      }
View Full Code Here

Examples of org.pdtextensions.core.launch.execution.ScriptExecutor

  public void launch(String argument, String[] params) throws ExecuteException, IOException, InterruptedException {
    CommandLine cmd = environment.getCommand();
    cmd.addArgument(argument);
    cmd.addArguments(params);
   
    executor = new ScriptExecutor();
   
    if (timeout != null) {
      executor.setTimeout(timeout);
    }
   
View Full Code Here

Examples of org.pdtextensions.core.launch.execution.ScriptExecutor

  @Override
  public void run() {
   
    try {
      ScriptExecutor executor = new ScriptExecutor();
      CommandLine cmd = new CommandLine(phPexeItem.getExecutable());
      cmd.addArgument("testexecutable");
     
      Bundle bundle = Platform.getBundle(PEXUIPlugin.PLUGIN_ID);
      URL entry = bundle.getEntry("Resources/launcher");
     
      File file = new File(FileLocator.resolve(entry).toURI());
     
      if (file != null) {
        executor.setWorkingDirectory(file);
      }

      executor.addResponseListener(listener);
      executor.execute(cmd);
    } catch (Exception e) {
      Logger.logException(e);
    }
  }
View Full Code Here

Examples of org.springframework.integration.scripting.ScriptExecutor

*
*/
public class ScriptTests {
  @Test
  public void testRuby() {
    ScriptExecutor executor = ScriptExecutorFactory.getScriptExecutor("ruby");

    Order order = new Order(0);
    order.addItem(DrinkType.LATTE, 2, false);
    Map<String, Object> variables = new HashMap<String, Object>();
    variables.put("payload", order.getItems().get(0));
    variables.put("timeToPrepare", 1L);

    Object obj = executor.executeScript(
        new ResourceScriptSource(new FileSystemResource("scripts/ruby/barista.rb")), variables);
    assertNotNull(obj);
    assertTrue(obj instanceof Drink);

  }
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.