com.codemesh.terp.eval.executors
Class JavaExecutor
java.lang.Object
com.codemesh.terp.api.Executor.AbstractExecutor<ProcessExecutor.Result>
com.codemesh.terp.eval.executors.ProcessExecutor
com.codemesh.terp.eval.executors.ShellExecutor
com.codemesh.terp.eval.executors.BatchExecutor
com.codemesh.terp.eval.executors.JavaExecutor
- All Implemented Interfaces:
- Executor<ProcessExecutor.Result>, Named, Versioned, java.io.Serializable
public class JavaExecutor
- extends BatchExecutor
- implements Named, Versioned, java.io.Serializable
An executor for Java programs.
- See Also:
- Serialized Form
| 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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JAVA_EXE_NAME
protected static final java.lang.String JAVA_EXE_NAME
theOS
protected static final OS theOS
bIsWindows
protected static final boolean bIsWindows
bIsMacOS
protected static final boolean bIsMacOS
EXECUTABLE
protected static final java.lang.String EXECUTABLE
- See Also:
- Constant Field Values
JRE
protected static final java.lang.String JRE
- See Also:
- Constant Field Values
JDK
protected static final java.lang.String JDK
- See Also:
- Constant Field Values
MAKER
protected static final java.lang.String MAKER
- See Also:
- Constant Field Values
VERSION
protected static final java.lang.String VERSION
- See Also:
- Constant Field Values
SUN_JAVA_VERSION
protected static final java.util.regex.Pattern SUN_JAVA_VERSION
TO_VERSION
protected static final ToVersion TO_VERSION
TO_FILE
protected static final ToFile TO_FILE
TO_JRE
protected static final ToJre TO_JRE
TO_JDK
protected static final ToJdk TO_JDK
logger
protected static final java.util.logging.Logger logger
theJre
protected Jre theJre
theVersion
protected Version theVersion
theMaker
protected java.lang.String theMaker
JavaExecutor
public JavaExecutor()
setJre
public void setJre(Jre jre)
getJre
public Jre getJre()
- Returns the JRE to which this Java executable belongs.
- Returns:
- the owning JRE.
getName
public java.lang.String getName()
- Returns the named object's name.
- Specified by:
getName in interface Named
- Returns:
- the name.
getVersion
public Version getVersion()
- Returns the Java version as reported by running the executable
with the -version argument.
- Specified by:
getVersion in interface Versioned
- Returns:
- the Java version.
setMaker
public void setMaker(java.lang.String maker)
- Sets the Java executor's maker code.
- Parameters:
maker - the maker code.- See Also:
for a list of supported maker codes.
getMaker
public java.lang.String getMaker()
- Returns a code for the maker of the JRE.
Currently supported maker codes include: sun, ibm,
oracle, and bea.
- Returns:
- the maker code.
fromMap
public static JavaExecutor fromMap(JavaExecutor exec,
java.util.Map<java.lang.String,java.lang.Object> map)
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 BatchExecutor
- 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.
batchExecute
public ProcessExecutor.Result batchExecute(java.util.List<java.lang.Object> args)
Copyright © 2008-2012 by Codemesh, Inc. All Rights Reserved.