public abstract class AbstractJvmModelExecTask<T extends AbstractJvmExecSpec, P extends SerializableWorkerAppParameters> extends GrolifantDefaultTask implements ForkedJvmExecutable, JvmExecutionModel
Configures a task that will run an execution in a forked JVM.
| Constructor and description |
|---|
protected AbstractJvmModelExecTask
(WorkerExecutor we)Base class for executing tasks on the JVM. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
protected abstract org.ysb33r.grolifant5.api.remote.worker.WorkerAppExecutorFactory<P> |
createExecutorFactory()Create a worker app executor factory. |
|
protected abstract WorkerAppParameterFactory<P> |
createParameterFactory()Create a worker app parameter factory. |
|
public T |
entrypoint(Action<JvmEntryPoint> configurator)Configures the entrypoint for the JVM executable. |
|
public T |
entrypoint(groovy.lang.Closure<?> configurator)Configures the entrypoint for the JVM executable |
|
protected void |
exec() |
|
public JvmEntryPoint |
getEntrypoint()Get direct access to the JvmEntryPoint instance. |
|
public JavaForkOptionsWithEnvProvider |
getJvm()Direct access to the JavaForkOptionsWithEnvProvider instance. |
|
protected T |
getJvmExecSpec() |
|
public ProcessExecutionSpec |
getProcess()Get direct access to the ProcessExecutionSpec instance. |
|
public CmdlineArgumentSpec |
getRunnerSpec()Get direct access to the CmdlineArgumentSpec instance. |
|
public T |
jvm(Action<JavaForkOptionsWithEnvProvider> configurator)Configures a JVM that will be forked. |
|
public T |
jvm(groovy.lang.Closure<?> configurator)Configures a JVM that will be forked. |
|
protected void |
preventExecutionMode(ExecutionMode mode, String reason)Prevents a specific execution mode from being set. |
|
public T |
process(Action<ProcessExecutionSpec> configurator)Configures the stream redirection and exit code checks. |
|
public T |
process(groovy.lang.Closure<?> configurator)Configures the stream redirections and exit checks. |
|
protected void |
processOutput(ExecOutput output)Process the output from an ExecOutput. |
|
public T |
runnerSpec(Action<CmdlineArgumentSpec> configurator)Configures the arguments. |
|
public T |
runnerSpec(groovy.lang.Closure<?> configurator)Configures the arguments. |
|
public void |
setAwaitMode(Boolean mode)Set whether other tasks in this project should be blocked until this task's worker queue completed. |
|
protected void |
setExecSpec(T execSpec) |
|
public void |
setExecutionMode(ExecutionMode em)Sets the execution mode. |
| Methods inherited from class | Name |
|---|---|
class GrolifantDefaultTask |
execTools, fsOperations, getGrolifantSecurePropertyService, jvmTools, problemReporter, projectTools, providerTools, stringTools |
Base class for executing tasks on the JVM.
we - Can be null, in which case workers will not be supportedCreate a worker app executor factory.
Create a worker app parameter factory.
Configures the entrypoint for the JVM executable.
This includes the classpath, modularity and main class.
configurator - An action to configure the entrypointConfigures the entrypoint for the JVM executable
configurator - A closure to configure the entrypointGet direct access to the JvmEntryPoint instance.
Direct access to the JavaForkOptionsWithEnvProvider instance.
Get direct access to the ProcessExecutionSpec instance.
Get direct access to the CmdlineArgumentSpec instance.
Configures a JVM that will be forked.
configurator - An action to configure the JVM's fork options.Configures a JVM that will be forked.
configurator - A closure to configure the JVM's fork options.Prevents a specific execution mode from being set.
mode - Illegal execution modereason - Reason why execution mode cannot be used.Configures the stream redirection and exit code checks.
This includes the inputs and output streams as well as the exit value.
configurator - An action to configure the execution.Configures the stream redirections and exit checks.
configurator - A closure to configure the execution.Process the output from an ExecOutput.
output - Output to process.Configures the arguments.
configurator - An action to configure the arguments.Configures the arguments.
configurator - A closure to configure the arguments.Set whether other tasks in this project should be blocked until this task's worker queue completed.
Ignored if executionMode == JAVA_EXEC.
mode - true is blocking is required.Sets the execution mode.
This allows for JVM tasks to be executed either on a worker queue inside the JVM using an isolated classpath,
outside the JVM in a separate process, OR using a classic javaexec.
If nothing is set, the default is ExecutionMode#JAVA_EXEC#JAVA_EXEC.
em - Execution mode.