terp - the Codemesh Modular
Template Interpreter v1.3.304

com.codemesh.terp.eval.executors
Class BatchExecutor

java.lang.Object
  extended by com.codemesh.terp.api.Executor.AbstractExecutor<ProcessExecutor.Result>
      extended by com.codemesh.terp.eval.executors.ProcessExecutor
          extended by com.codemesh.terp.eval.executors.ShellExecutor
              extended by com.codemesh.terp.eval.executors.BatchExecutor
All Implemented Interfaces:
Executor<ProcessExecutor.Result>
Direct Known Subclasses:
JavaExecutor, JavaToolExecutor

public class BatchExecutor
extends ShellExecutor

A shell executor that can bundle up several requests in a batch/script file and run them in one shell.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.codemesh.terp.eval.executors.ProcessExecutor
ProcessExecutor.Result
 
Nested classes/interfaces inherited from interface com.codemesh.terp.api.Executor
Executor.AbstractExecutor<T>, Executor.ForMethod
 
Field Summary
 
Fields inherited from class com.codemesh.terp.eval.executors.ShellExecutor
theExecFlag, theShell, TO_STRING
 
Fields inherited from class com.codemesh.terp.eval.executors.ProcessExecutor
EOL, IS_WINDOWS, logger, theEnvironment, theExecutable, theWorkingDir, TO_FILE, TO_LIST
 
Constructor Summary
BatchExecutor()
           
 
Method Summary
static BatchExecutor batchFromFile(java.io.File executable)
           
static BatchExecutor batchFromMap(BatchExecutor result, java.util.Map<java.lang.String,java.lang.Object> map)
           
static BatchExecutor batchFromMap(java.util.Map<java.lang.String,java.lang.Object> map)
           
static BatchExecutor batchFromString(java.lang.String executable)
           
 ProcessExecutor.Result execute(java.util.List<java.lang.Object> args, TerpEvaluator eval, TerpContext ctx)
          Performs the executor's action on the given arguments in the given context.
protected  boolean writeCommandsFile(java.io.File batchFile, java.util.List<java.lang.Object> args)
           
 
Methods inherited from class com.codemesh.terp.eval.executors.ShellExecutor
createEnvironment, getExecFlag, getShell, marshallArguments, setExecFlag, setShell, shellFromFile, shellFromMap, shellFromMap, shellFromString
 
Methods inherited from class com.codemesh.terp.eval.executors.ProcessExecutor
execute, fromFile, fromMap, fromMap, fromString, getEnvironment, getExecutable, getWorkingDir, matches, setEnvironment, setExecutable, setWorkingDir
 
Methods inherited from class com.codemesh.terp.api.Executor.AbstractExecutor
execute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchExecutor

public BatchExecutor()
Method Detail

batchFromString

public static BatchExecutor batchFromString(java.lang.String executable)

batchFromFile

public static BatchExecutor batchFromFile(java.io.File executable)

batchFromMap

public static BatchExecutor batchFromMap(java.util.Map<java.lang.String,java.lang.Object> map)

batchFromMap

public static BatchExecutor batchFromMap(BatchExecutor result,
                                         java.util.Map<java.lang.String,java.lang.Object> map)

writeCommandsFile

protected boolean writeCommandsFile(java.io.File batchFile,
                                    java.util.List<java.lang.Object> args)

execute

public ProcessExecutor.Result execute(java.util.List<java.lang.Object> args,
                                      TerpEvaluator eval,
                                      TerpContext ctx)
Description copied from interface: Executor
Performs the executor's action on the given arguments in the given context. Typically, your custom executor will implement this method to provide its core functionality.

Specified by:
execute in interface Executor<ProcessExecutor.Result>
Overrides:
execute in class ProcessExecutor
Parameters:
args - the arguments.
eval - the evaluator to use. Can frequently be null.
ctx - the context in which the execution occurs. Can frequently be null.
Returns:
the execution result.

terp - the Codemesh Modular
Template Interpreter v1.3.304

Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.